Package io.manebot.database.model
Class Permission
- java.lang.Object
-
- io.manebot.database.model.TimedRow
-
- io.manebot.database.model.Permission
-
- All Implemented Interfaces:
GrantedPermission
@Entity public class Permission extends TimedRow implements GrantedPermission
-
-
Constructor Summary
Constructors Constructor Description Permission(Database database)
Permission(Database database, Entity entity, User grantingUser, java.lang.String node, boolean allow)
-
Method Summary
Modifier and Type Method Description java.util.Date
getDate()
Gets the date this permission was granted.Entity
getEntity()
Gets the entity that this granted permission is associated with.Grant
getGrant()
Gets the grant that is explicitly defined by this permission.User
getGranter()
Gets the user that granted this permission.Permission
getPermission()
Gets the permission node that this granted permission refers to.int
getPermissionId()
int
hashCode()
void
remove()
Removes this granted permissionvoid
setGrant(Grant grant)
-
Methods inherited from class io.manebot.database.model.TimedRow
getCreated, getCreatedDate, getUpdated, getUpdatedDate, setCreated, setCreated, setCreatedDate, setUpdated, setUpdated, setUpdatedDate
-
-
-
-
Method Detail
-
getPermissionId
public int getPermissionId()
-
getEntity
public Entity getEntity()
Description copied from interface:GrantedPermission
Gets the entity that this granted permission is associated with.- Specified by:
getEntity
in interfaceGrantedPermission
- Returns:
- Entity instance.
-
getPermission
public Permission getPermission()
Description copied from interface:GrantedPermission
Gets the permission node that this granted permission refers to.- Specified by:
getPermission
in interfaceGrantedPermission
- Returns:
-
getGrant
public Grant getGrant()
Description copied from interface:GrantedPermission
Gets the grant that is explicitly defined by this permission.- Specified by:
getGrant
in interfaceGrantedPermission
- Returns:
- Grant instance.
-
setGrant
public void setGrant(Grant grant)
-
getGranter
public User getGranter()
Description copied from interface:GrantedPermission
Gets the user that granted this permission.- Specified by:
getGranter
in interfaceGrantedPermission
- Returns:
- User instance.
-
getDate
public java.util.Date getDate()
Description copied from interface:GrantedPermission
Gets the date this permission was granted.- Specified by:
getDate
in interfaceGrantedPermission
- Returns:
- Date instance.
-
remove
public void remove() throws java.lang.SecurityException
Description copied from interface:GrantedPermission
Removes this granted permission- Specified by:
remove
in interfaceGrantedPermission
- Throws:
java.lang.SecurityException
- ifa security violation is detected attempting to remove this permission.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-