HSAdmin Backend Domains, E-Mail, Datenbanken
Purodha Blissenbach
2012-08-16 ee5fbad2545db1ea878aea5848fe5effef7d16a7
Privileges added: super stupid implememtation allow everyone to to
everything and that cannot be altered.
2 files added
69 ■■■■■ changed files
hsarback/src/de/hsadmin/core/model/PrivilegesInterface.java 12 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/PrivilegesModuleImpl.java 57 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/PrivilegesInterface.java
New 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 ) ;
}
hsarback/src/de/hsadmin/core/model/PrivilegesModuleImpl.java
New 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;
    }
}