Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merged from AccessControl branch: bulk patch for AccessControl
added: privacy enforcement for package on flags privacy, readaccess and binarydownload added: new flag definitions fixed: acl DB migration class fixed, moved to newest migration fixed: missing places for new readaccess / privacy flags adding support for role="reader" with the new flags <readaccess> and <privacy>
- Loading branch information
Showing
14 changed files
with
160 additions
and
18 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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class PrivacyFlag < Flag | ||
belongs_to :db_project | ||
belongs_to :db_package | ||
belongs_to :architecture | ||
|
||
default_state :disabled | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class ReadaccessFlag < Flag | ||
belongs_to :db_project | ||
belongs_to :db_package | ||
belongs_to :architecture | ||
|
||
default_state :enabled | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class AddReviewerRole < ActiveRecord::Migration | ||
def self.up | ||
reviewer = Role.create :title => 'reviewer' | ||
end | ||
|
||
def self.down | ||
Role.find_by_title('reviewer').destroy | ||
end | ||
end |
24 changes: 24 additions & 0 deletions
24
src/api/db/migrate/20100328100000_add_new_permissions_and_role.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class AddNewPermissionsAndRole < ActiveRecord::Migration | ||
def self.up | ||
readperm = StaticPermission.create :title => 'read_access' | ||
privperm = StaticPermission.create :title => 'private_view' | ||
reader = Role.create :title => 'reader' | ||
maintainer = Role.find_by_title 'maintainer' | ||
|
||
[maintainer,reader].each do |role| | ||
role.static_permissions << readperm | ||
end | ||
maintainer.static_permissions << privperm | ||
end | ||
|
||
def self.down | ||
perm = StaticPermission.find_by_title('read_access') | ||
if perm | ||
perm.destroy | ||
end | ||
perm = StaticPermission.find_by_title('private_view') | ||
if perm | ||
perm.destroy | ||
end | ||
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