public class AuthorizationHelper extends Object
Constructor and Description |
---|
AuthorizationHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canAccess(rst.domotic.unit.UnitConfigType.UnitConfig unitConfig,
String userId,
Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> groups,
Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> locations)
Checks whether a user has the permission to access a unit with the given permissionConfig.
|
static boolean |
canRead(rst.domotic.unit.UnitConfigType.UnitConfig unitConfig,
String userId,
Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> groups,
Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> locations)
Checks whether a user has the permission to read from a permissionConfig,
for example to query information about the unit's state who has this permissionConfig.
|
static boolean |
canWrite(rst.domotic.unit.UnitConfigType.UnitConfig unitConfig,
String userId,
Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> groups,
Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> locations)
Checks whether a user has the permission to write to a something with the given permissionConfig,
for example to run any action on a unit.
|
static rst.domotic.authentication.PermissionType.Permission |
getPermission(rst.domotic.unit.UnitConfigType.UnitConfig unitConfig,
String userId,
Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> groups,
Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> locations)
Checks all permissions for a user.
|
public static boolean canRead(rst.domotic.unit.UnitConfigType.UnitConfig unitConfig, String userId, Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> groups, Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> locations) throws org.openbase.jul.exception.CouldNotPerformException
unitConfig
- The unitConfig of the unit the user wants to read.userId
- ID of the user whose permissions should be checked.groups
- All available groups in the system, indexed by their group ID.locations
- All available locations in the system, indexed by their id.org.openbase.jul.exception.CouldNotPerformException
- If the permissions could not be checked, probably because of invalid location information.public static boolean canWrite(rst.domotic.unit.UnitConfigType.UnitConfig unitConfig, String userId, Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> groups, Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> locations) throws org.openbase.jul.exception.CouldNotPerformException
unitConfig
- The unitConfig of the unit the user wants to write to.userId
- ID of the user whose permissions should be checked.groups
- All available groups in the system, indexed by their group ID.locations
- All available locations in the system, indexed by their id.org.openbase.jul.exception.CouldNotPerformException
- If the permissions could not be checked, probably because of invalid location information.public static boolean canAccess(rst.domotic.unit.UnitConfigType.UnitConfig unitConfig, String userId, Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> groups, Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> locations) throws org.openbase.jul.exception.CouldNotPerformException
unitConfig
- The unitConfig of the unit the user wants to access.userId
- ID of the user whose permissions should be checked.groups
- All available groups in the system, indexed by their group ID.locations
- All available locations in the system, indexed by their id.org.openbase.jul.exception.CouldNotPerformException
- If the permissions could not be checked, probably because of invalid location information.public static rst.domotic.authentication.PermissionType.Permission getPermission(rst.domotic.unit.UnitConfigType.UnitConfig unitConfig, String userId, Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> groups, Map<String,org.openbase.jul.extension.protobuf.IdentifiableMessage<String,rst.domotic.unit.UnitConfigType.UnitConfig,rst.domotic.unit.UnitConfigType.UnitConfig.Builder>> locations) throws org.openbase.jul.exception.CouldNotPerformException
unitConfig
- The unitConfig of the unit for which the permissions apply.userId
- ID of the user whose permissions should be checked.groups
- All available groups in the system, indexed by their group ID.locations
- All available locations in the system, indexed by their id.org.openbase.jul.exception.CouldNotPerformException
- If the permissions could not be checked, probably because of invalid location information.Copyright © 2017–2018 openbase.org. All rights reserved.