lib/chef/provider/user/dscl.rb
#
# Returns true if user is member of the specified group, false otherwise.
#
Returns true if user is member of the specified group, false otherwise.
Returns true if user is member of the specified group false otherwise .
def member_of_group?(group_name)
          membership_info = ""
          begin
            membership_info = run_dscl("read /Groups/#{group_name}")
          rescue Chef::Exceptions::DsclCommandFailed
          end
          members = membership_info.split(" ")
          members.shift 
          members.include?(@new_resource.username)
        end
def member_of_group? ( group_name ) membership_info = "" begin membership_info = run_dscl ( "read /Groups/#{group_name}" ) rescue Chef :: Exceptions :: DsclCommandFailed end members = membership_info . split ( " " ) members . shift members . include? ( @new_resource . username ) end
Returns true if user is member of the specified group, false otherwise.
Returns true if user is member of the specified group false otherwise .
# Raised if the group doesn't contain any members # Output is something like: # GroupMembership: root admin etc # Get rid of GroupMembership: string
group_name
<not_specific>