Privileges added: super stupid implememtation allow everyone to to
everything and that cannot be altered.
This commit is contained in:
parent
cf132cf569
commit
ee5fbad254
12
hsarback/src/de/hsadmin/core/model/PrivilegesInterface.java
Normal file
12
hsarback/src/de/hsadmin/core/model/PrivilegesInterface.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package de.hsadmin.core.model;
|
||||||
|
|
||||||
|
import de.hsadmin.mods.user.UnixUser;
|
||||||
|
|
||||||
|
public interface PrivilegesInterface {
|
||||||
|
|
||||||
|
public boolean isAllowedToCreate( UnixUser user, AbstractEntity entity ) ;
|
||||||
|
public boolean isAllowedToSearch( UnixUser user, AbstractEntity entity ) ;
|
||||||
|
public boolean isAllowedToUpdate( UnixUser user, AbstractEntity orignalentity, AbstractEntity targetentity ) ;
|
||||||
|
public boolean isAllowedToDelete( UnixUser user, AbstractEntity entity ) ;
|
||||||
|
|
||||||
|
}
|
57
hsarback/src/de/hsadmin/core/model/PrivilegesModuleImpl.java
Normal file
57
hsarback/src/de/hsadmin/core/model/PrivilegesModuleImpl.java
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
package de.hsadmin.core.model;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import de.hsadmin.mods.user.UnixUser;
|
||||||
|
|
||||||
|
public class PrivilegesModuleImpl extends AbstractModuleImpl implements PrivilegesInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AbstractEntity add(AbstractEntity newEntity) throws HSAdminException {
|
||||||
|
return super.add(newEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AbstractEntity> search(
|
||||||
|
Class<? extends AbstractEntity> entityClass, String condition,
|
||||||
|
String orderBy) throws HSAdminException {
|
||||||
|
return super.search(entityClass, condition, orderBy);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AbstractEntity update(AbstractEntity existingEntity)
|
||||||
|
throws HSAdminException {
|
||||||
|
return super.update(existingEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(AbstractEntity existingEntity) throws HSAdminException {
|
||||||
|
super.delete(existingEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAllowedToCreate(UnixUser user, AbstractEntity entity) {
|
||||||
|
// stupid generic implementation allowing everything.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAllowedToSearch(UnixUser user, AbstractEntity entity) {
|
||||||
|
// stupid generic implementation allowing everything.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAllowedToUpdate(UnixUser user,
|
||||||
|
AbstractEntity orignalentity, AbstractEntity targetentity) {
|
||||||
|
// stupid generic implementation allowing everything.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAllowedToDelete(UnixUser user, AbstractEntity entity) {
|
||||||
|
// stupid generic implementation allowing everything.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user