hasPermissions

 

The "hasPermissions" action returns whether the specified account has the specified permissions. 

 

Request examples

Typical

{
  "action": "hasPermissions",
  "params": {
    "userName": "my_account",
    "permissions": [
      {
        "privilege": "readAnyRecordInAnyTableInAnyDatabase"
      },
      {
        "privilege": "manageAnyServer"
      },
      {
        "privilege": "manageTheSecurityOfAnyServer"
      },
      {
        "privilege": "describeOneTable",
        "objectName": "my_table"
      }
      {
        "privilege": "manageOneDatabase",
        "objectName": "db47"
      }
    ]
  },
  "authToken": "replaceWithAuthTokenFromCreateSession"
}
 
 

 

Response examples

Typical

{
  "result": {
    "hasAllRequestedPermissions": false,
    "permissions": [
      {
        "privilege": "readAnyRecordInAnyTableInAnyDatabase"
      },
      {
        "privilege": "describeOneTable",
        "objectName": "my_table",
        "databaseName": "d3",
        "namespace": "n5"
      }
    ],
    "shallowDenials": [
      {
        "privilege": "manageAnyServer"
      },
      {
        "privilege": "manageOneDatabase",
        "objectName": "db47"
      }
    ],
    "recursiveDenials": [
      {
        "privilege": "manageTheSecurityOfAnyServer"
      }
    ]
  },
  "authToken": "replaceWithAuthTokenFromCreateSession"
}
 
 

 

Properties

Request properties

Property Description Default Type Limits (inclusive)

userName

The "username" property specifies the name that uniquely identifies the account that will be checked for the specified privileges.  Required - No default value string 1 to 64 bytes

permissions

The "permissions" property specifies which permissions to assign to a role. Optional with default of [] array of objects

"objectName"

"privilege"

permissions

.databaseName

The "databaseName" property specifies the database that contains an object.  Required when a privilege contains the word "one" and specifies an object in a database string 1 to 64 bytes

permissions

.namespace

The "namespace" property specifies the name of an existing namespace.  Required when a privilege contains the word "one" and specifies the object type as "table", "codepackage", "procedure", "sequence", "synonym", or "view". string Matches the limits of the object type specified by the privilege. 1 to 64 bytes

permissions

.objectName

The "objectName" property is the name of an object, such as a table name.  Required when a privilege contains the word "one" and specifies the object type as "server", "database", "table", "record", "codepackage", "view", "procedure", "mqsession", "mqtopic", "brokerconnection", "connector", "account", or "role". string Matches the limits of the object type specified by the privilege. 1 to 65,500 bytes

permissions

.privilege

The "privilege" property specifies one of FairCom's predefined privilege names.  Required - No default value string 1 to 64 bytes

 

Response properties

Property Description Type Limits (inclusive)

hasAllRequestedPermissions

The "hasAllRequestedPermissions" property indicates whether the account specified in the request has all the permissions included in the request.  Boolean

true

false

permissions

The "permissions" property specifies which permissions to assign to a role. array of objects

"objectName"

"privilege"

permissions

.databaseName

The "databaseName" property specifies the database that contains an object.  string 1 to 64 bytes

permissions

.namespace

The "namespace" property specifies the name of an existing namespace.  string Matches the limits of the object type specified by the privilege. 1 to 64 bytes

permissions

.objectName

The "objectName" property is the name of an object, such as a table name.  string Matches the limits of the object type specified by the privilege. 1 to 65,500 bytes

permissions

.privilege

The "privilege" property specifies one of FairCom's predefined privilege names.  string 1 to 64 bytes

shallowDenials

The "shallowDenials" property denies a role from having the specified privileges but does not deny the descendants of those privileges. For example, you could deny a role from managing a server while permitting the role to manage one of its databases. array of objects 0 or more privilege objects

shallowDenials

.databaseName

The "databaseName" property specifies the database that contains an object.  string 1 to 64 bytes

shallowDenials

.namespace

The "namespace" property specifies the name of an existing namespace.  string Matches the limits of the object type specified by the privilege. 1 to 64 bytes

shallowDenials

.objectName

The "objectName" property is the name of an object, such as a table name.  string Matches the limits of the object type specified by the privilege. 1 to 65,500 bytes

shallowDenials

.privilege

The "privilege" property specifies one of FairCom's predefined privilege names.  string 1 to 64 bytes

recursiveDenials

The "recursiveDenials" property denies a role from having the specified privileges and their descendants. For example, if you deny a role from managing a server, it also denies all its descendant privileges which includes all non-security privileges. 

Note Only privileges with "manage" in their name have descendants. Because of this, "recursiveDenials" is different from "shallowDenials" only for "manage" privileges.

array of objects 0 or more privilege objects

recursiveDenials

.databaseName

The "databaseName" property specifies the database that contains an object.  string 1 to 64 bytes

recursiveDenials

.namespace

The "namespace" property specifies the name of an existing namespace.  string Matches the limits of the object type specified by the privilege. 1 to 64 bytes

recursiveDenials

.objectName

The "objectName" property is the name of an object, such as a table name.  string Matches the limits of the object type specified by the privilege. 1 to 65,500 bytes

recursiveDenials

.privilege

The "privilege" property specifies one of FairCom's predefined privilege names.  string 1 to 64 bytes