Cross Reference: permission.rb
xref
: /
ontohub
/
app
/
models
/
permission.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
permission.rb revision cdb58a323a2a1b4c2191163a6a6772658462c136
fdbad18e66c0e293f94694458d47df305f050c71
Christian Maeder
class
Permission
<
ActiveRecord
::
Base
fdbad18e66c0e293f94694458d47df305f050c71
Christian Maeder
fdbad18e66c0e293f94694458d47df305f050c71
Christian Maeder
# thrown if the last
admin
/
owner
tries to remove itself
fdbad18e66c0e293f94694458d47df305f050c71
Christian Maeder
class
PowerVaccuumError
<
Exception
;
end
5214cf3742dc626a7efc5ec851db09bf0ff1f579
Christian Maeder
e973af819c2fb17f426944c8c4cfa00de5cd81a1
Christian Maeder
belongs_to
:
subject
, :
polymorphic
=>
true
b96b500ba4430269d97a08f07de87838278e9c5d
Christian Maeder
belongs_to
:
item
, :
polymorphic
=>
true
96f7c7a07f939807a52234fde508fac35bd3405b
Christian Maeder
e973af819c2fb17f426944c8c4cfa00de5cd81a1
Christian Maeder
scope
:
item
, ->
(
item
)
{
5214cf3742dc626a7efc5ec851db09bf0ff1f579
Christian Maeder
where
\
5214cf3742dc626a7efc5ec851db09bf0ff1f579
Christian Maeder
item_id
:
item.id
,
5214cf3742dc626a7efc5ec851db09bf0ff1f579
Christian Maeder
item_type
:
item.class.to
_s
}
scope
:
subject
, ->
(
subject
)
{
where
\
subject_id
:
subject.id
,
subject_type
:
subject.class.to
_s
}
end