dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20568
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9430: sharing: added new check, canManage (aliased to canWrite for now)
------------------------------------------------------------
revno: 9430
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-01-03 13:51:34 +0100
message:
sharing: added new check, canManage (aliased to canWrite for now)
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultSecurityService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/SecurityService.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultSecurityService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultSecurityService.java 2013-01-03 12:43:44 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultSecurityService.java 2013-01-03 12:51:34 +0000
@@ -289,6 +289,12 @@
return isCurrentUser( identifiableObject.getUser() );
}
+ @Override
+ public boolean canManage( IdentifiableObject identifiableObject )
+ {
+ return canWrite( identifiableObject );
+ }
+
public boolean isCurrentUser( User user )
{
return currentUserService.getCurrentUser() == user;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/SecurityService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/SecurityService.java 2013-01-03 12:43:44 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/SecurityService.java 2013-01-03 12:51:34 +0000
@@ -90,7 +90,7 @@
* Checks whether current user has read access to object.
*
* @param identifiableObject Object to check for read access.
- * @return true of false depending on outcome of readable check
+ * @return true of false depending on outcome of read check
*/
boolean canRead( IdentifiableObject identifiableObject );
@@ -98,23 +98,31 @@
* Checks whether current user has write access to object.
*
* @param identifiableObject Object to check for write access.
- * @return true of false depending on outcome of writable check
+ * @return true of false depending on outcome of write check
*/
boolean canWrite( IdentifiableObject identifiableObject );
/**
- * Checks whether current user has read access to object.
+ * Checks whether current user has update access to object.
*
- * @param identifiableObject Object to check for read access.
- * @return true of false depending on outcome of readable check
+ * @param identifiableObject Object to check for update access.
+ * @return true of false depending on outcome of update check
*/
boolean canUpdate( IdentifiableObject identifiableObject );
/**
- * Checks whether current user has read access to object.
+ * Checks whether current user has delete access to object.
*
- * @param identifiableObject Object to check for read access.
- * @return true of false depending on outcome of readable check
+ * @param identifiableObject Object to check for delete access.
+ * @return true of false depending on outcome of delete check
*/
boolean canDelete( IdentifiableObject identifiableObject );
+
+ /**
+ * Checks whether current user has manage access to object.
+ *
+ * @param identifiableObject Object to check for manage access.
+ * @return true of false depending on outcome of manage check
+ */
+ boolean canManage( IdentifiableObject identifiableObject );
}