com.atlassian.gadgets.refimpl
Class PermissionServiceImpl
java.lang.Object
com.atlassian.gadgets.refimpl.PermissionServiceImpl
- All Implemented Interfaces:
- com.atlassian.gadgets.dashboard.spi.DashboardPermissionService, com.atlassian.gadgets.directory.spi.DirectoryPermissionService
public class PermissionServiceImpl
- extends Object
- implements com.atlassian.gadgets.dashboard.spi.DashboardPermissionService, com.atlassian.gadgets.directory.spi.DirectoryPermissionService
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)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PermissionServiceImpl
public PermissionServiceImpl(com.atlassian.sal.api.user.UserManager userManager)
isReadableBy
public boolean isReadableBy(com.atlassian.gadgets.dashboard.DashboardId dashboardId,
String username)
- Specified by:
isReadableBy
in interface com.atlassian.gadgets.dashboard.spi.DashboardPermissionService
isWritableBy
public boolean isWritableBy(com.atlassian.gadgets.dashboard.DashboardId dashboardId,
String username)
- Specified by:
isWritableBy
in interface com.atlassian.gadgets.dashboard.spi.DashboardPermissionService
canConfigureDirectory
public boolean canConfigureDirectory(String username)
- Specified by:
canConfigureDirectory
in interface com.atlassian.gadgets.directory.spi.DirectoryPermissionService
Copyright © 2013 Atlassian. All Rights Reserved.