app/models/learning_plan.rb
# Return a hash describing privileges of the specified user
# on this learning plan
Return a hash describing privileges of the specified user
on this learning plan
Return a hash describing privileges of the specified user on this learning plan
def privileges(u)
		p = TinyPrivileges.new
		return p if u.nil?
		return p.grant_all if u.admin?
		return p.grant_all if u == user.coordinator
		if u == user or u.privilege >= User::PRIVILEGE_STAFF
			p[:view] = 
			p[:browse] = 
			p[:create_note] = 
			p[:view_note] = true
		end
		return p
	end
def privileges ( u ) p = TinyPrivileges . new return p if u . nil? return p . grant_all if u . admin? return p . grant_all if u == user . coordinator if u == user or u . privilege >= User :: PRIVILEGE_STAFF p [ :view ] = p [ :browse ] = p [ :create_note ] = p [ :view_note ] = true end return p end
Return a hash describing privileges of the specified user
on this learning plan
Return a hash describing privileges of the specified user on this learning plan
# create a new privileges object with no rights # user must be specified otherwise no privileges # an admin has full privileges ########################################## # see if the user is the student's coordinator - if there is # no coordinator we are done, there are no privileges ########################################## # USER IS THE STUDENT, OR ANY STAFF MEMBER # grant read and note privileges.
u
<not_specific>