Module: Controlist::Permissions

Defined in:
lib/controlist/permissions/constrain.rb,
lib/controlist/permissions/operation.rb,
lib/controlist/permissions/ordered_package.rb,
lib/controlist/permissions/simple_constrain.rb,
lib/controlist/permissions/advanced_constrain.rb

Defined Under Namespace

Classes: AdvancedConstrain, Constrain, OrderedPackage, SimpleConstrain

Constant Summary collapse

CREATE =
:create
READ =
:read
UPDATE =
:update
DELETE =
:delete

Class Method Summary collapse

Class Method Details

.is_create?(operation) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/controlist/permissions/operation.rb', line 15

def is_create?(operation)
  CREATE == operation.to_sym
end

.is_delete?(operation) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/controlist/permissions/operation.rb', line 27

def is_delete?(operation)
  DELETE == operation.to_sym
end

.is_persistence?(operation) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/controlist/permissions/operation.rb', line 11

def is_persistence?(operation)
  [CREATE, UPDATE, DELETE].include? operation.to_sym
end

.is_read?(operation) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/controlist/permissions/operation.rb', line 19

def is_read?(operation)
  READ == operation.to_sym
end

.is_update?(operation) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/controlist/permissions/operation.rb', line 23

def is_update?(operation)
  UPDATE == operation.to_sym
end