package org.openslx.dozmod.permissions; import org.openslx.bwlp.thrift.iface.LectureRead; import org.openslx.dozmod.thrift.Session; /** * Class for checking, whether user can edit given lecture */ public class LecturePerms { public static boolean canEdit(LectureRead lecture){ if(lecture.getOwnerId().equals(Session.getUserId())) return true; if(lecture.userPermissions !=null) { return lecture.userPermissions.edit; } if (lecture.defaultPermissions != null) return lecture.defaultPermissions.edit; return false; } }