module ChefFixie::AuthzGroupMixin
Public Instance Methods
group()
click to toggle source
Todo: filter this by scope and type
# File lib/chef_fixie/authz_objects.rb, line 263 def group ChefFixie::AuthzMapper.struct_to_name(group_raw) end
group_add(entity)
click to toggle source
# File lib/chef_fixie/authz_objects.rb, line 276 def group_add(entity) group_add_raw(entity.type, entity) end
group_add_raw(actor_or_group, entity)
click to toggle source
# File lib/chef_fixie/authz_objects.rb, line 271 def group_add_raw(actor_or_group, entity) entity_resource = to_resource(actor_or_group) authz_api.put("#{prefix}/#{entity_resource}/#{entity.authz_id}", {}) end
group_delete(entity)
click to toggle source
# File lib/chef_fixie/authz_objects.rb, line 285 def group_delete(entity) group_delete_raw(entity.type, entity) end
group_delete_raw(actor_or_group, entity)
click to toggle source
# File lib/chef_fixie/authz_objects.rb, line 280 def group_delete_raw(actor_or_group, entity) entity_resource = to_resource(actor_or_group) authz_api.delete("#{prefix}/#{entity_resource}/#{entity.authz_id}") end
group_raw()
click to toggle source
Groups need a little more code to manage members.
# File lib/chef_fixie/authz_objects.rb, line 258 def group_raw authz_api.get("#{prefix}") end
list()
click to toggle source
# File lib/chef_fixie/authz_objects.rb, line 267 def list group end
member?(entity)
click to toggle source
# File lib/chef_fixie/authz_objects.rb, line 289 def member?(entity) members = group_raw members[resourcify_actor_or_group(entity.type)].member?(entity.authz_id) end
type()
click to toggle source
# File lib/chef_fixie/authz_objects.rb, line 253 def type :group end