app/roles/authority.rb
def add_access(user, *access)
    access = if access.include?(:admin)
               { project_access: UsersProject::MASTER }
             elsif access.include?(:write)
               { project_access: UsersProject::DEVELOPER }
             else
               { project_access: UsersProject::REPORTER }
             end
    opts = { user: user }
    opts.merge!(access)
    users_projects.create(opts)
  end
# Compatible with all access rights
# Should be rewrited for new access rights
Compatible with all access rights
Should be rewrited for new access rights
Compatible with all access rights Should be rewrited for new access rights
def add_access(user, *access)
    access = if access.include?(:admin)
               { project_access: UsersProject::MASTER }
             elsif access.include?(:write)
               { project_access: UsersProject::DEVELOPER }
             else
               { project_access: UsersProject::REPORTER }
             end
    opts = { user: user }
    opts.merge!(access)
    users_projects.create(opts)
  end
def add_access ( user , * access ) access = if access . include? ( :admin ) { project_access : UsersProject :: MASTER } elsif access . include? ( :write ) { project_access : UsersProject :: DEVELOPER } else { project_access : UsersProject :: REPORTER } end opts = { user : user } opts . merge! ( access ) users_projects . create ( opts ) end
Compatible with all access rights
Should be rewrited for new access rights
Compatible with all access rights Should be rewrited for new access rights
user
access