Class: Textus::Domain::Permission
- Inherits:
-
Data
- Object
- Data
- Textus::Domain::Permission
- Defined in:
- lib/textus/domain/permission.rb
Instance Attribute Summary collapse
-
#readable_by ⇒ Object
readonly
Returns the value of attribute readable_by.
-
#writable_by ⇒ Object
readonly
Returns the value of attribute writable_by.
-
#zone ⇒ Object
readonly
Returns the value of attribute zone.
Instance Method Summary collapse
Instance Attribute Details
#readable_by ⇒ Object (readonly)
Returns the value of attribute readable_by
3 4 5 |
# File 'lib/textus/domain/permission.rb', line 3 def readable_by @readable_by end |
#writable_by ⇒ Object (readonly)
Returns the value of attribute writable_by
3 4 5 |
# File 'lib/textus/domain/permission.rb', line 3 def writable_by @writable_by end |
#zone ⇒ Object (readonly)
Returns the value of attribute zone
3 4 5 |
# File 'lib/textus/domain/permission.rb', line 3 def zone @zone end |
Instance Method Details
#allows_read?(role) ⇒ Boolean
8 9 10 11 12 |
# File 'lib/textus/domain/permission.rb', line 8 def allows_read?(role) return true if readable_by == :all readable_by.include?(role.to_s) end |
#allows_write?(role) ⇒ Boolean
4 5 6 |
# File 'lib/textus/domain/permission.rb', line 4 def allows_write?(role) writable_by.include?(role.to_s) end |