This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
tuxbliki/app/controllers/permissions.rb

27 lines
713 B
Ruby

class Permissions < Application
def show
@author = Author.find(params[:id])
raise NotFound unless @author
@permissions = @author.permissions
@secondary_title = "Permissions for #{@author.name}"
render
end
def edit
only_provides :html
@author = Author.find(params[:id])
raise NotFound unless @author
@permissions = Permission.find :all, :order => 'name ASC'
@secondary_title = "Change permissions for #{@author.name}"
render
end
def update
@author = Author.find(params[:id])
raise NotFound unless @author
@permissions = Permission.find(params[:permissions])
@author.permissions = @permissions
redirect url(:permission, @author)
end
end