Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.course.disclaimer;
import java.util.List;
import org.olat.basesecurity.IdentityRef;
import org.olat.core.id.Identity;
import org.olat.repository.RepositoryEntry;
import org.olat.repository.RepositoryEntryRef;
/*
* Date: 24 Mar 2020<br>
* @author Alexander Boeckle
*/
public interface CourseDisclaimerManager {
/**
* Revokes all consents related to disclaimer of a repository entry
*
* @param repositoryEntryRef
*/
public void revokeAllConsents(RepositoryEntryRef repositoryEntryRef);
/**
* Deletes all consents related to a disclaimer of repository entry
*
* @param repositoryEntryRef
*/
public void removeAllConsents(RepositoryEntryRef repositoryEntryRef);
/**
* Accepts a disclaimer for repository entry
*
* @param repositoryEntry
* @param identity
* @param disc1Accepted
* @param disc2Accepted
*/
public void acceptDisclaimer(RepositoryEntry repositoryEntry, Identity identity, boolean disc1Accepted, boolean disc2Accepted);
/**
* Deletes all disclaimer consent database entries related to a repository entry and a list of users
*
* @param repositoryEntryRef
* @param identityKeys
*/
public void removeConsents(RepositoryEntryRef repositoryEntryRef, List<Long> identityKeys);
/**
* Revokes all disclaimer consents related to a repository entry and a list of users
*
* @param repositoryEntryRef
* @param identityKeys
*/
public void revokeConsents(RepositoryEntryRef repositoryEntryRef, List<Long> identityKeys);
/**
* Returns all consents related to a repository entry
*
* @param repositoryEntryRef
* @return List<CourseDisclaimerConsent>
*/
public List<CourseDisclaimerConsent> getConsents(RepositoryEntryRef repositoryEntryRef);
/**
* Returns whether access to a repository entry is granted or not to a user
*
* @param repositoryEntry
* @param identityRef
* @return boolean
*/
public boolean isAccessGranted(RepositoryEntry repositoryEntry, IdentityRef identityRef);
/**
* Returns whether any disclaimer has been accepted yet
*
* @param repositoryEntryRef
* @return boolean
*/
public boolean hasAnyConsent(RepositoryEntryRef repositoryEntryRef);
/**
* Returns the amount of consents to a repository entry
*
* @param repositoryEntryRef
* @return Long
*/
public Long countConsents(RepositoryEntryRef repositoryEntryRef);
/**
* Returns whether any entry in the database for this repository entry is existing
* @param repositoryEntryRef
* @return boolean
*/
public boolean hasAnyEntry(RepositoryEntryRef repositoryEntryRef);