Created
December 16, 2010 15:37
-
-
Save diebels727/743532 to your computer and use it in GitHub Desktop.
user.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Within the user model | |
... | |
#READONLY! Sets all of the user tokens to read-only. | |
def readonly! | |
self.tokens.each do |t| | |
t.capabilities = [:list,:view,:search] | |
end | |
end | |
... | |
#Again, a quick hack. I don't like explicitly specifying the capabilities. I saw in Husk capabilities that you put | |
#together some constants for specifying capabilities. | |
#I want to make sure that this doesn't 'break' the current User/Group/Token interaction. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment