projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow self-activation after signing required user agreements.
[arvados.git]
/
services
/
api
/
app
/
models
/
authorized_key.rb
diff --git
a/services/api/app/models/authorized_key.rb
b/services/api/app/models/authorized_key.rb
index e931fe77bafcda1e0d260fbe7bdcdc9bae854e84..afb33e60f8121229c15d003129a3d4492f250055 100644
(file)
--- a/
services/api/app/models/authorized_key.rb
+++ b/
services/api/app/models/authorized_key.rb
@@
-2,20
+2,20
@@
class AuthorizedKey < ArvadosModel
include AssignUuid
include KindAndEtag
include CommonApiTemplate
include AssignUuid
include KindAndEtag
include CommonApiTemplate
- before_create :permission_to_set_authorized_user
- before_update :permission_to_set_authorized_user
+ before_create :permission_to_set_authorized_user
_uuid
+ before_update :permission_to_set_authorized_user
_uuid
- belongs_to :authorized_user, :foreign_key => :authorized_user, :class_name => 'User', :primary_key => :uuid
+ belongs_to :authorized_user, :foreign_key => :authorized_user
_uuid
, :class_name => 'User', :primary_key => :uuid
- api_accessible :
superuser, :extend =>
:common do |t|
+ api_accessible :
user, extend:
:common do |t|
t.add :name
t.add :key_type
t.add :name
t.add :key_type
- t.add :authorized_user
+ t.add :authorized_user
_uuid
t.add :public_key
t.add :expires_at
end
t.add :public_key
t.add :expires_at
end
- def permission_to_set_authorized_user
+ def permission_to_set_authorized_user
_uuid
# Anonymous users cannot do anything here
return false if !current_user
# Anonymous users cannot do anything here
return false if !current_user
@@
-23,7
+23,7
@@
class AuthorizedKey < ArvadosModel
return true if current_user.is_admin
# All users can attach keys to their own accounts
return true if current_user.is_admin
# All users can attach keys to their own accounts
- return true if current_user.uuid == authorized_user
+ return true if current_user.uuid == authorized_user
_uuid
# Default = deny.
false
# Default = deny.
false