Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F462409
user.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 18, 10:05 PM
Size
724 B
Mime Type
text/x-ruby
Expires
Tue, May 20, 10:05 PM (18 h, 31 m)
Engine
blob
Format
Raw Data
Handle
220595
Attached To
rARCHIVING archiving
user.rb
View Options
class
User
<
ActiveRecord
::
Base
has_many
:ownerships
has_many
:hosts
,
through
:
:ownerships
,
inverse_of
:
:users
enum
user_type
:
{
institutional
:
0
,
vima
:
1
,
okeanos
:
2
,
admin
:
3
}
validates
:username
,
:user_type
,
presence
:
true
# Composes the user's display name from the user's username and email
#
# @return [String]
def
display_name
"
#{
username
}
<
#{
email
}
>"
end
# Determines if the user must select hosts from a list or enter their
# FQDN manually
#
# @return [Boolean]
def
needs_host_list?
vima?
||
okeanos?
end
# Marks a user as not enabled
def
ban
self
.
enabled
=
false
save
end
# Marks a user as enabled
def
unban
self
.
enabled
=
true
save
end
end
Event Timeline
Log In to Comment