|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.gadgets.refimpl.PermissionServiceImpl
public class PermissionServiceImpl
Simple implementation of the permission service. Dashboards with ids less than 1000 are readable and writable by everyone. Dashboards with ids greather than or equal to 1000 and less than 10000 are readable by everyone but writes are restricted to logged in users. Dashboards with ids greater than or equal to 10000 are only readable or writable by logged in users. For tabs, Dashboards with ids greater than 100000 will have 5 tabs (in groups of five). So for example when visiting the dashboard with id 100002, a user will see these tabs: 100000|100001|100002*|100003|100004. Also only tabs with even ids will have write permission. All tabs are readable by logged in users, Accessing dashboard 100002 as a logged in user will display these tabs: 100000|100001|100002*|100003|100004 (however only tabs 100000, 100002 and 100004 are writable)
Constructor Summary | |
---|---|
PermissionServiceImpl(com.atlassian.sal.api.user.UserManager userManager)
|
Method Summary | |
---|---|
boolean |
canConfigureDirectory(String username)
Returns true if the user identified by username has permission to add new external gadgets to the
directory, remove external gadgets that were previously added, and otherwise configure the directory. |
boolean |
isReadableBy(DashboardId dashboardId,
String username)
Returns true if the user identified by username has permission to view the dashboard identified
by the DashboardId , false otherwise. |
boolean |
isWritableBy(DashboardId dashboardId,
String username)
Returns true if the user identified by username has permission to modify the dashboard identified
by the DashboardId , false otherwise. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PermissionServiceImpl(com.atlassian.sal.api.user.UserManager userManager)
Method Detail |
---|
public boolean isReadableBy(DashboardId dashboardId, String username)
DashboardPermissionService
true
if the user identified by username
has permission to view the dashboard identified
by the DashboardId
, false
otherwise. This method should also return false if the dashboard
specified by the DashboardId
doesn't exist.
isReadableBy
in interface DashboardPermissionService
dashboardId
- the DashboardId
of the dashboard the user is trying to viewusername
- the name of the user logged in, null
if no user is currently logged in
true
if the user identified by username
has permission to view the dashboard identified
by the DashboardId
, false
otherwise.public boolean isWritableBy(DashboardId dashboardId, String username)
DashboardPermissionService
true
if the user identified by username
has permission to modify the dashboard identified
by the DashboardId
, false
otherwise. This method should also return false if the dashboard
specified by the DashboardId
doesn't exist.
isWritableBy
in interface DashboardPermissionService
dashboardId
- the DashboardId
of the dashboard the user is trying to modifyusername
- the name of the user logged in, null
if no user is currently logged in
true
if the user identified by username
has permission to modify the dashboard identified
by the DashboardId
, false
otherwise.public boolean canConfigureDirectory(String username)
DirectoryPermissionService
true
if the user identified by username
has permission to add new external gadgets to the
directory, remove external gadgets that were previously added, and otherwise configure the directory. Returns
false
if the specified user does not have this permission. Generally, this permission should be
restricted to administrators, as gadgets have security considerations that can impact the whole system.
canConfigureDirectory
in interface DirectoryPermissionService
username
- the name of the user logged in, null
if no user is currently logged in
true
if the user identified by username
has permission to configure the directory,
false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |