Class: AuthorizationAction

bo.rules. AuthorizationAction

Specifies the operations of models to authorize.

new AuthorizationAction()

Creates a new enumeration to define the authorization actions. Members:

  • fetchObject
  • createObject
  • updateObject
  • removeObject
  • executeCommand
  • executeMethod
  • readProperty
  • writeProperty

Extends

Members

<readonly> $name :string

The name of the enumeration. The default value is the name of the constructor.

Type:
  • string
Inherited From:

<readonly> createObject :number

The user tries to save the values of a new model to the repository.

Type:
  • number
Default Value:
  • 1

<readonly> executeCommand :number

The user tries to execute a command in the repository.

Type:
  • number
Default Value:
  • 4

<readonly> executeMethod :number

The user tries to execute a custom action in the repository. It can be a custom fetch or execute action.

Type:
  • number
Default Value:
  • 5

<readonly> fetchObject :number

The user tries to retrieve the values of a model from the repository.

Type:
  • number
Default Value:
  • 0

<readonly> readProperty :number

The user tries to get the value of a property.

Type:
  • number
Default Value:
  • 6

<readonly> removeObject :number

The user tries to delete the values of a model from the repository.

Type:
  • number
Default Value:
  • 3

<readonly> updateObject :number

The user tries to save the changed values of a model to the repository.

Type:
  • number
Default Value:
  • 2

<readonly> writeProperty :number

The user tries to set the value of a property.

Type:
  • number
Default Value:
  • 7

Methods

check(value, message, messageParams)

Checks whether the enumeration has an item with the given value. If not, throws an error.

Parameters:
Name Type Argument Description
value number

The value to check.

message string <optional>

Human-readable description of the error.

messageParams * <optional>
<repeatable>

Optional interpolation parameters of the message.

Inherited From:
Throws:
Enumeration error: The passed value is not an enumeration item.

count() → {number}

Returns the count of the items in enumeration.

Inherited From:
Returns:

The count of the enumeration items.

Type
number

getName(value) → {string}

Returns the name of an enumeration item.

Parameters:
Name Type Description
value number

The enumeration item that name to be returned of.

Inherited From:
Throws:
Returns:

The name of the enumeration item.

Type
string

getValue(name) → {number}

Returns the value of an enumeration item based on its name.

Parameters:
Name Type Description
name string

The enumeration item that value to be returned of.

Inherited From:
Throws:
Returns:

The value of the enumeration item.

Type
number

hasMember(value) → {boolean}

Determines if the enumeration has an item with the given value.

Parameters:
Name Type Description
value number

The value to check.

Inherited From:
Returns:

True if the value is an enumeration item, otherwise false.

Type
boolean

hasValue(name) → {boolean}

Determines if the enumeration has an item with the given name.

Parameters:
Name Type Description
name string

The name of the enumeration item.

Inherited From:
Returns:

True if the name is an enumeration item, otherwise false.

Type
boolean
If you find bugs or have feature requests, please let us know.

JavaScript business objects ♦ Copyright © 2014-2016 Logikum, Ltd.
Documentation generated by JSDoc 3.2.2 on 2015. December 31. using the DocStrap template.