app/models/enju_biblio/ability.rb in enju_biblio-0.1.0.pre42 vs app/models/enju_biblio/ability.rb in enju_biblio-0.1.0.pre43

- old
+ new

@@ -29,14 +29,14 @@ Identifier, ImportRequest, ManifestationRelationship, ManifestationRelationshipType, Own, - Patron, - PatronImportFile, - PatronRelationship, - PatronRelationshipType, + Agent, + AgentImportFile, + AgentRelationship, + AgentRelationshipType, PictureFile, Produce, ProduceType, Realize, RealizeType, @@ -50,11 +50,11 @@ Frequency, FormOfWork, Language, License, MediumOfPerformance, - PatronType, + AgentType, RequestStatusType, RequestType ] if LibraryGroup.site_config.network_access_allowed?(ip_address) can :read, [ CarrierType, @@ -65,12 +65,12 @@ FormOfWork, IdentifierType, Language, License, MediumOfPerformance, - PatronImportResult, - PatronType, + AgentImportResult, + AgentType, RequestStatusType, RequestType, ResourceImportResult ] when 'Librarian' @@ -78,27 +78,27 @@ can :index, Manifestation can [:show, :create, :update], Manifestation can [:destroy, :delete], Manifestation do |manifestation| manifestation.items.empty? and !manifestation.series_master? end - can [:index, :create], Patron - can :show, Patron do |patron| + can [:index, :create], Agent + can :show, Agent do |patron| patron.required_role_id <= 3 end - can [:update, :destroy, :delete], Patron do |patron| + can [:update, :destroy, :delete], Agent do |patron| !patron.user.try(:has_role?, 'Librarian') and patron.required_role_id <= 3 end can :manage, [ Create, Donate, Exemplify, Identifier, ImportRequest, ManifestationRelationship, Own, - PatronImportFile, - PatronRelationship, + AgentImportFile, + AgentRelationship, PictureFile, Produce, Realize, ResourceImportFile, SeriesStatement @@ -112,13 +112,13 @@ FormOfWork, IdentifierType, Language, License, ManifestationRelationshipType, - PatronImportResult, - PatronRelationshipType, - PatronType, + AgentImportResult, + AgentRelationshipType, + AgentType, RequestStatusType, RequestType, ResourceImportResult, MediumOfPerformance ] @@ -129,15 +129,15 @@ end can :index, Manifestation can [:show, :edit], Manifestation do |manifestation| manifestation.required_role_id <= 2 end - can :index, Patron - can :update, Patron do |patron| + can :index, Agent + can :update, Agent do |patron| patron.user == user end - can :show, Patron do |patron| + can :show, Agent do |patron| #if patron.user == user # true #elsif patron.user != user true if patron.required_role_id <= 2 #name == 'Administrator' #end @@ -165,23 +165,23 @@ License, ManifestationRelationship, ManifestationRelationshipType, MediumOfPerformance, Own, - PatronRelationship, - PatronRelationshipType, + AgentRelationship, + AgentRelationshipType, Produce, Realize, SeriesStatement ] else can :index, Manifestation can :show, Manifestation do |manifestation| manifestation.required_role_id == 1 end - can :index, Patron - can :show, Patron do |patron| + can :index, Agent + can :show, Agent do |patron| patron.required_role_id == 1 #name == 'Guest' end can :read, [ CarrierType, ContentType, @@ -198,11 +198,11 @@ License, ManifestationRelationship, ManifestationRelationshipType, MediumOfPerformance, Own, - PatronRelationship, - PatronRelationshipType, + AgentRelationship, + AgentRelationshipType, PictureFile, Produce, Realize, SeriesStatement ]