{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":813,"path":"api-reference/server-api-reference/GlideSecurityManagerAPI.md","title":"GlideSecurityManager - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# GlideSecurityManager- Global\n\nThe GlideSecurityManager API provides methods that enable you to retrieve a SecurityManager object and to check if the current user has access rights, both table-level and field-level, to a specified GlideRecord table based on the configured Access Control Rules \\(ACLs\\).\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## GlideSecurityManager - get\\(\\)\n\nReturns a SecurityManager object.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|Object|SecurityManager object.|\n\nThe following code example shows how to call the GlideSecurityManager.get\\(\\) method to obtain a GlideSecurityManager object that is then used by the GlideSecurityManager.hasRightsTo\\(\\) method.\n\n```\nvar sm = GlideSecurityManager.get();\nvar grInc = new GlideRecord('incident');\nvar path = 'record/incident/read';\n\ngs.info(sm.hasRightsTo(path, grInc));\n\n```\n\nOutput:\n\n```\ntrue\n```\n\n## GlideSecurityManager - hasRightsTo\\(String path\\_to\\_resource, Object context\\)\n\nIndicates whether the current user has table-level access rights to a specified GlideRecord table based on the configured Access Control Rules \\(ACLs\\). This method evaluates all available ACLs for the specific resource.\n\nFor additional information on ACLs, see [Access Controls Evaluation Order](https://developer.servicenow.com/dev.do#!/learn/learning-plans/yokohama/servicenow_application_developer/app_store_learnv2_securingapps_yokohama_access_controls_evaluation_order).\n\n<table id=\"table_mvc_jxd_d2c\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\npath\\_to\\_resource\n\n</td><td>\n\nString\n\n</td><td>\n\nResource path to the GlideRecord table to check for access rights.For example: `record/incident/read`\n\nFormat: &lt;type&gt;/&lt;name&gt;/&lt;operation&gt;\n\n-   &lt;type&gt;: Type of resource. Valid values: Existing ACL types. Available from the drop-down choice list on the ACL form.\n-   &lt;name&gt;: Name of the table to check.\n-   &lt;operation&gt;: Name of the operation that you want to check access rights for. In this case \"read\".\n\n</td></tr><tr><td>\n\ncontext\n\n</td><td>\n\nObject\n\n</td><td>\n\nOptional. For table-level validation this field is not required.\n\n</td></tr></tbody>\n</table><table id=\"table_nvc_jxd_d2c\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the user's roles permit table-level reading of the specified table.Valid values:\n\n-   true: Specified access is permitted.\n-   false: Specified access isn't permitted.\n\n</td></tr></tbody>\n</table>The following code example shows how to use the hasRightsTo\\(\\) method to check if the current user has table-level read rights to all records in the Incident \\[incident\\] table.\n\n```\nvar sm = GlideSecurityManager.get();\nvar grInc = new GlideRecord('incident');\nvar path = 'record/incident/read';\n\ngs.info(sm.hasRightsTo(path, grInc));\n\n```\n\nOutput:\n\n```\nfalse\n```\n\n"}}