Class: Salesforce::Types::ObjectPermissions
- Inherits:
-
Object
- Object
- Salesforce::Types::ObjectPermissions
- Includes:
- ROXML
- Defined in:
- lib/mdata/types/ObjectPermissions.rb
Overview
A generic ObjectPermissions class that can be extended for specific metadata objects, e.g. ProfileObjectPermissions.
Direct Known Subclasses
Instance Method Summary collapse
-
#get_permissions ⇒ Array
Get an array of granted permissions.
-
#to_flag_style ⇒ String
A Unix flag style representation of the permissions, suitable for printing in a table.
Instance Method Details
#get_permissions ⇒ Array
Get an array of granted permissions
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mdata/types/ObjectPermissions.rb', line 23 def = [] .push 'allowCreate' if @allowCreate == 'true' .push 'allowDelete' if @allowDelete == 'true' .push 'allowEdit' if @allowEdit == 'true' .push 'allowRead' if @allowRead == 'true' .push 'modifyAllRecords' if @modifyAllRecords == 'true' .push 'viewAllRecords' if @viewAllRecords == 'true' end |
#to_flag_style ⇒ String
A Unix flag style representation of the permissions, suitable for printing in a table
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/mdata/types/ObjectPermissions.rb', line 38 def to_flag_style = '' if @allowCreate == 'true' += 'allowCreate ' else += ' ' end if @allowDelete == 'true' += 'allowDelete ' else += ' ' end if @allowEdit == 'true' += 'allowEdit ' else += ' ' end if @allowRead == 'true' += 'allowRead ' else += ' ' end if @modifyAllRecords == 'true' += 'modifyAllRecords ' else += ' ' end if @viewAllRecords == 'true' += 'viewAllRecords' else += ' ' end end |