Skip to content

Instantly share code, notes, and snippets.

@diebels727
Created December 16, 2010 15:37
Show Gist options
  • Save diebels727/743532 to your computer and use it in GitHub Desktop.
Save diebels727/743532 to your computer and use it in GitHub Desktop.
user.rb
#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