This repository has been archived by the owner on Mar 27, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
52 additions
and
76 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
class ApplicationAuthorizer < Authority::Authorizer | ||
|
||
def self.default(adjective, user) | ||
def self.default(_adjective, _user) | ||
false | ||
end | ||
|
||
end |
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
class PageAuthorizer < ApplicationAuthorizer | ||
|
||
def readable_by?(user) | ||
def readable_by?(_user) | ||
false # TODO | ||
end | ||
|
||
def updatable_by?(user) | ||
user.admin?(:edit_pages) | ||
end | ||
|
||
alias_method :deletable_by?, :updatable_by? | ||
|
||
alias deletable_by? updatable_by? | ||
end |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
class PictureAuthorizer < ApplicationAuthorizer | ||
|
||
def readable_by?(user) | ||
resource.album.readable_by?(user) | ||
end | ||
|
||
def creatable_by?(user) | ||
resource.person == user or | ||
(resource.album and resource.album.creatable_by?(user)) | ||
resource.person == user || | ||
(resource.album && resource.album.creatable_by?(user)) | ||
end | ||
|
||
def updatable_by?(user) | ||
resource.person == user or | ||
resource.album.updatable_by?(user) | ||
resource.person == user || | ||
resource.album.updatable_by?(user) | ||
end | ||
|
||
alias_method :deletable_by?, :updatable_by? | ||
alias_method :rotatable_by?, :updatable_by? | ||
alias deletable_by? updatable_by? | ||
alias rotatable_by? updatable_by? | ||
|
||
def self.readable_by(user, scope = Picture.all) | ||
def self.readable_by(_user, _scope = Picture.all) | ||
end | ||
|
||
end |
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
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