Class: Scrivito::Membership

Inherits:
Object
  • Object
show all
Defined in:
app/cms/scrivito/membership.rb

Overview

Represents a Membership of a User in a Workspace.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#roleString (readonly)

Note:

Currently the only available role is “owner”.

The role associated with this membership.



19
20
21
# File 'app/cms/scrivito/membership.rb', line 19

def role
  @role
end

#user_idString (readonly)

The User’s id



11
12
13
# File 'app/cms/scrivito/membership.rb', line 11

def user_id
  @user_id
end

Instance Method Details

#userObject

Fetches and returns the User with the id #user_id. Uses the proc set in Configuration.find_user to fetch the user.



33
34
35
# File 'app/cms/scrivito/membership.rb', line 33

def user
  User.find(user_id) || User.unknown_user(user_id)
end