summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/permissions/LecturePerms.java
blob: 335913fdbcd0ed90e4f1cc5642fd8ee3b1a00bd9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package org.openslx.dozmod.permissions;

import org.openslx.bwlp.thrift.iface.LectureRead;
import org.openslx.bwlp.thrift.iface.LectureSummary;

/**
 * Class for checking, whether user can edit given lecture
 */
public class LecturePerms {
	public static boolean canEdit(LectureRead lecture) {
		return lecture != null && lecture.userPermissions != null && lecture.userPermissions.edit;
	}
	public static boolean canEdit(LectureSummary lecture) {
		return lecture != null && lecture.userPermissions != null && lecture.userPermissions.edit;
	}
	public static boolean canAdmin(LectureRead lecture) {
		return lecture != null && lecture.userPermissions != null && lecture.userPermissions.admin;
	}
	public static boolean canAdmin(LectureSummary lecture) {
		return lecture != null && lecture.userPermissions != null && lecture.userPermissions.admin;
	}
}