Initial impl of Authenticator and jsp files

This commit is contained in:
Ziver Koc 2017-10-19 15:46:38 +02:00
parent 41b7baa382
commit 58d4ab2f75
153 changed files with 7557 additions and 11415 deletions

View file

@ -0,0 +1,30 @@
package zall.manager;
import zall.bean.Folder;
import zall.bean.Media;
import zall.bean.User;
/**
*
*/
public class AuthenticationManager {
/**
* @return true if the specified user can edit the media
*/
public static boolean canEdit(User user, Media target) {
return target != null && (user.isSuperUser() || target.getUser().equals(user));
}
/**
* @return true if the specified user can edit the media
*/
public static boolean canEdit(User user, Folder target) {
return target != null && (user.isSuperUser() || user.equals( target.getUser() ));
}
/**
* @return true if the specified user can edit the profile of the other user
*/
public static boolean canEdit(User user, User target){
return user.equals( target ) || user.isSuperUser();
}
}