Class: Organization

Inherits:
Object
  • Object
show all
Includes:
DataMapper::Resource
Defined in:
models/organization.rb

Overview

Represents a group of Users, usually by functional team. Some parts of permissions model based around Organization membership.

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from DataMapper::Resource

#make_dirty

Class Method Details

+ (Integer) approver_orgs(repository = nil)

Returns IDs of Organizations who can approve for this user. Nil if none can.

Returns:

  • (Integer)

    IDs of Organizations who can approve for this user. Nil if none can.



23
# File 'models/organization.rb', line 23

property :approver_orgs,	CommaSeparatedList

+ (Integer) approver_users(repository = nil)

Returns IDs of Users who can approve for this user. Nil if none can.

Returns:

  • (Integer)

    IDs of Users who can approve for this user. Nil if none can.



22
# File 'models/organization.rb', line 22

property :approver_users,	CommaSeparatedList

+ (Boolean) canReport(repository = nil)

Returns True if this Organization's Users can use reporting tools

Returns:

  • (Boolean)

    True if this Organization's Users can use reporting tools



19
# File 'models/organization.rb', line 19

property :canReport,		Boolean, :default => true

+ (Boolean) contractor(repository = nil)

Returns True if this Organization is a contractor group

Returns:

  • (Boolean)

    True if this Organization is a contractor group



16
# File 'models/organization.rb', line 16

property :contractor,		Boolean, :default => false

+ (Integer) dashconfig(repository = nil)

Returns The dashboard configuration Users in this org should see. 0 represents default dash

Returns:

  • (Integer)

    The dashboard configuration Users in this org should see. 0 represents default dash



17
# File 'models/organization.rb', line 17

property :dashconfig,		Integer, :default => 0

+ (Integer) id(repository = nil)

Returns Primary Key

Returns:

  • (Integer)

    Primary Key



13
# File 'models/organization.rb', line 13

property :id,				Serial

+ (String) name(repository = nil)

Returns Organization name

Returns:

  • (String)

    Organization name



14
# File 'models/organization.rb', line 14

property :name,				String

+ (Boolean) requireApproval(repository = nil)

Returns Perm bit. True if this user needs approval to pass/fail a test

Returns:

  • (Boolean)

    Perm bit. True if this user needs approval to pass/fail a test



20
# File 'models/organization.rb', line 20

property :requireApproval,	Boolean, :default => false

+ (Boolean) super(repository = nil)

Returns True if this Organization is Super (can view all Applications). While not deprecated, this is rarely used with the new permissions model.

Returns:

  • (Boolean)

    True if this Organization is Super (can view all Applications). While not deprecated, this is rarely used with the new permissions model.



15
# File 'models/organization.rb', line 15

property :super,			Boolean, :default => false

Instance Method Details

- (Array<User>) activeUsers

Get all active Users belonging to the Organization

Returns:

  • (Array<User>)

    Active Users who are members of the Organization



28
29
30
# File 'models/organization.rb', line 28

def activeUsers
	return User.all(:active => true, :org => self.id)
end

- (Array<User>) allUsers

Get all Users belonging to the Organization

Returns:

  • (Array<User>)

    All Users who are members of the Organization



35
36
37
# File 'models/organization.rb', line 35

def allUsers
	return User.all(:org => self.id)
end

- (Integer) approver_orgs

Returns IDs of Organizations who can approve for this user. Nil if none can.

Returns:

  • (Integer)

    IDs of Organizations who can approve for this user. Nil if none can.



23
# File 'models/organization.rb', line 23

property :approver_orgs,	CommaSeparatedList

- (Integer) approver_orgs=(value)

Returns IDs of Organizations who can approve for this user. Nil if none can.

Returns:

  • (Integer)

    IDs of Organizations who can approve for this user. Nil if none can.



23
# File 'models/organization.rb', line 23

property :approver_orgs,	CommaSeparatedList

- (Integer) approver_users

Returns IDs of Users who can approve for this user. Nil if none can.

Returns:

  • (Integer)

    IDs of Users who can approve for this user. Nil if none can.



22
# File 'models/organization.rb', line 22

property :approver_users,	CommaSeparatedList

- (Integer) approver_users=(value)

Returns IDs of Users who can approve for this user. Nil if none can.

Returns:

  • (Integer)

    IDs of Users who can approve for this user. Nil if none can.



22
# File 'models/organization.rb', line 22

property :approver_users,	CommaSeparatedList

- (Boolean) canReport

Returns True if this Organization's Users can use reporting tools

Returns:

  • (Boolean)

    True if this Organization's Users can use reporting tools



19
# File 'models/organization.rb', line 19

property :canReport,		Boolean, :default => true

- (Boolean) canReport=(value)

Returns True if this Organization's Users can use reporting tools

Returns:

  • (Boolean)

    True if this Organization's Users can use reporting tools



19
# File 'models/organization.rb', line 19

property :canReport,		Boolean, :default => true

- (Boolean) contractor

Returns True if this Organization is a contractor group

Returns:

  • (Boolean)

    True if this Organization is a contractor group



16
# File 'models/organization.rb', line 16

property :contractor,		Boolean, :default => false

- (Boolean) contractor=(value)

Returns True if this Organization is a contractor group

Returns:

  • (Boolean)

    True if this Organization is a contractor group



16
# File 'models/organization.rb', line 16

property :contractor,		Boolean, :default => false

- (Integer) dashconfig

Returns The dashboard configuration Users in this org should see. 0 represents default dash

Returns:

  • (Integer)

    The dashboard configuration Users in this org should see. 0 represents default dash



17
# File 'models/organization.rb', line 17

property :dashconfig,		Integer, :default => 0

- (Integer) dashconfig=(value)

Returns The dashboard configuration Users in this org should see. 0 represents default dash

Returns:

  • (Integer)

    The dashboard configuration Users in this org should see. 0 represents default dash



17
# File 'models/organization.rb', line 17

property :dashconfig,		Integer, :default => 0

- (Integer) id

Returns Primary Key

Returns:

  • (Integer)

    Primary Key



13
# File 'models/organization.rb', line 13

property :id,				Serial

- (Integer) id=(value)

Returns Primary Key

Returns:

  • (Integer)

    Primary Key



13
# File 'models/organization.rb', line 13

property :id,				Serial

- (String) name

Returns Organization name

Returns:

  • (String)

    Organization name



14
# File 'models/organization.rb', line 14

property :name,				String

- (String) name=(value)

Returns Organization name

Returns:

  • (String)

    Organization name



14
# File 'models/organization.rb', line 14

property :name,				String

- (Boolean) requireApproval

Returns Perm bit. True if this user needs approval to pass/fail a test

Returns:

  • (Boolean)

    Perm bit. True if this user needs approval to pass/fail a test



20
# File 'models/organization.rb', line 20

property :requireApproval,	Boolean, :default => false

- (Boolean) requireApproval=(value)

Returns Perm bit. True if this user needs approval to pass/fail a test

Returns:

  • (Boolean)

    Perm bit. True if this user needs approval to pass/fail a test



20
# File 'models/organization.rb', line 20

property :requireApproval,	Boolean, :default => false

- (Boolean) super

Returns True if this Organization is Super (can view all Applications). While not deprecated, this is rarely used with the new permissions model.

Returns:

  • (Boolean)

    True if this Organization is Super (can view all Applications). While not deprecated, this is rarely used with the new permissions model.



15
# File 'models/organization.rb', line 15

property :super,			Boolean, :default => false

- (Boolean) super=(value)

Returns True if this Organization is Super (can view all Applications). While not deprecated, this is rarely used with the new permissions model.

Returns:

  • (Boolean)

    True if this Organization is Super (can view all Applications). While not deprecated, this is rarely used with the new permissions model.



15
# File 'models/organization.rb', line 15

property :super,			Boolean, :default => false