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.DategetDate()Gets the date this permission was granted.EntitygetEntity()Gets the entity that this granted permission is associated with.GrantgetGrant()Gets the grant that is explicitly defined by this permission.UsergetGranter()Gets the user that granted this permission.PermissiongetPermission()Gets the permission node that this granted permission refers to.intgetPermissionId()inthashCode()voidremove()Removes this granted permissionvoidsetGrant(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:GrantedPermissionGets the entity that this granted permission is associated with.- Specified by:
getEntityin interfaceGrantedPermission- Returns:
- Entity instance.
-
getPermission
public Permission getPermission()
Description copied from interface:GrantedPermissionGets the permission node that this granted permission refers to.- Specified by:
getPermissionin interfaceGrantedPermission- Returns:
-
getGrant
public Grant getGrant()
Description copied from interface:GrantedPermissionGets the grant that is explicitly defined by this permission.- Specified by:
getGrantin interfaceGrantedPermission- Returns:
- Grant instance.
-
setGrant
public void setGrant(Grant grant)
-
getGranter
public User getGranter()
Description copied from interface:GrantedPermissionGets the user that granted this permission.- Specified by:
getGranterin interfaceGrantedPermission- Returns:
- User instance.
-
getDate
public java.util.Date getDate()
Description copied from interface:GrantedPermissionGets the date this permission was granted.- Specified by:
getDatein interfaceGrantedPermission- Returns:
- Date instance.
-
remove
public void remove() throws java.lang.SecurityExceptionDescription copied from interface:GrantedPermissionRemoves this granted permission- Specified by:
removein interfaceGrantedPermission- Throws:
java.lang.SecurityException- ifa security violation is detected attempting to remove this permission.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-