Add pickups role
This commit is contained in:
parent
4c41a99fde
commit
ac11ba1cc1
14 changed files with 42 additions and 15 deletions
|
|
@ -159,17 +159,22 @@ class User < ActiveRecord::Base
|
|||
def role_article_meta?
|
||||
groups.detect {|group| group.role_article_meta?}
|
||||
end
|
||||
|
||||
|
||||
# Checks the suppliers role
|
||||
def role_suppliers?
|
||||
groups.detect {|group| group.role_suppliers?}
|
||||
end
|
||||
|
||||
|
||||
# Checks the invoices role
|
||||
def role_pickups?
|
||||
groups.detect {|group| group.role_pickups?}
|
||||
end
|
||||
|
||||
# Checks the orders role
|
||||
def role_orders?
|
||||
groups.detect {|group| group.role_orders?}
|
||||
end
|
||||
|
||||
|
||||
def ordergroup_name
|
||||
ordergroup ? ordergroup.name : I18n.t('model.user.no_ordergroup')
|
||||
end
|
||||
|
|
@ -178,7 +183,7 @@ class User < ActiveRecord::Base
|
|||
def member_of?(group)
|
||||
group.users.exists?(self.id)
|
||||
end
|
||||
|
||||
|
||||
#Returns an array with the users groups (but without the Ordergroups -> because tpye=>"")
|
||||
def member_of_groups()
|
||||
self.groups.where(type: '')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue