k-int / KBPlus

KnowledgeBase Plus
http://www.kbplus.ac.uk/kbplus
Other
10 stars 8 forks source link

You should not be able to Copy things you can't View #303

Closed ostephens closed 11 years ago

ostephens commented 11 years ago

At the moment it is possible to create a copy of a licence from http://test.kbplus.ac.uk/kbplus/myInstitutions/University_of_Westminster/addLicense or a Subscription from http://test.kbplus.ac.uk/kbplus/myInstitutions/University_of_Westminster/addSubscription, without having permission to view the thing you are copying.

You should only be able to Copy things you can already View

ianibo commented 11 years ago

Implemented with flash message as per deletes.. Commited, needs test refresh and test.

ostephens commented 11 years ago

This now seems to test for 'edit' permissions on the the object you wish to copy? Correct behaviour is that you should be able to copy things if you have at least 'view' perms on them. E.g. User: TestUserB: UoW Admin [HH] / tF2UwXx/Z3WL5CLCXhfGFva3pxM=@edina.ac.uk User roles: University_of_Westminster:1:INST_ADM Try to copy http://test.kbplus.ac.uk/kbplus/licenseDetails/index/1, get error "You do not have edit permission for the selected license."

I look at the permissions via /additionalInfo

The following organisations are granted the listed permissions from this licence

OrganisationRoles and Permissions
IoP Publishing Limited Connected to this license through role Licensor.
This role grants the following permissions to members of that org whose membership role also includes the permission
JISC Collections Connected to this license through role Licensing Consortium.
This role grants the following permissions to members of that org whose membership role also includes the permission
  • edit [Not granted]
  • view [Granted]

Logged in user permissions

Affiliated via RolePermissions
Affiliated to University of Westminster with role Editor
  • edit
  • view
--> This org is related to JISC Collections ( Consortium )
  • view