Browse code

BM-15098 Fix: let cyrus checks write rights

David Phan authored on 05/08/2019 07:00:32
Showing 1 changed files
... ...
@@ -187,7 +187,6 @@ public class ImapMailboxRecordsService extends BaseMailboxRecordsService impleme
187 187
 
188 188
 	@Override
189 189
 	public void deleteById(long id) {
190
-		rbac.check(Verb.Write.name());
191 190
 		logger.info("Delete {}", id);
192 191
 		ItemValue<MailboxItem> toDelete = getCompleteById(id);
193 192
 		if (toDelete != null) {
... ...
@@ -204,7 +203,6 @@ public class ImapMailboxRecordsService extends BaseMailboxRecordsService impleme
204 203
 
205 204
 	@Override
206 205
 	public void resync() {
207
-		rbac.check(Verb.Write.name());
208 206
 		long time = System.currentTimeMillis();
209 207
 		Collection<Integer> imapUids = imapContext.withImapClient((sc, fast) -> {
210 208
 			sc.select(imapFolder);
... ...
@@ -249,7 +247,6 @@ public class ImapMailboxRecordsService extends BaseMailboxRecordsService impleme
249 247
 
250 248
 	@Override
251 249
 	public Ack updateById(long id, MailboxItem mail) {
252
-		rbac.check(Verb.Write.name());
253 250
 		if (mail.imapUid == 0) {
254 251
 			logger.warn("Not updating {} with imapUid 0", id);
255 252
 			return Ack.create(0L);
... ...
@@ -412,7 +409,6 @@ public class ImapMailboxRecordsService extends BaseMailboxRecordsService impleme
412 409
 
413 410
 	@Override
414 411
 	public ItemIdentifier create(MailboxItem value) {
415
-		rbac.check(Verb.Write.name());
416 412
 		IOfflineMgmt offlineApi = context.provider().instance(IOfflineMgmt.class, imapContext.user.domainUid,
417 413
 				imapContext.user.uid);
418 414
 		IdRange alloc = offlineApi.allocateOfflineIds(1);
... ...
@@ -421,7 +417,6 @@ public class ImapMailboxRecordsService extends BaseMailboxRecordsService impleme
421 417
 
422 418
 	@Override
423 419
 	public Ack createById(long id, MailboxItem value) {
424
-		rbac.check(Verb.Write.name());
425 420
 		ItemIdentifier itemIdentifier = create(id, value);
426 421
 		return Ack.create(itemIdentifier.version);
427 422
 	}
... ...
@@ -661,7 +656,6 @@ public class ImapMailboxRecordsService extends BaseMailboxRecordsService impleme
661 656
 
662 657
 	@Override
663 658
 	public String uploadPart(Stream part) {
664
-		rbac.check(Verb.Write.name());
665 659
 		String addr = UUID.randomUUID().toString();
666 660
 		logger.info("[{}] Upload starts {}...", addr, part);
667 661
 		CompletableFuture<Void> upload = EZInputStreamAdapter.consume(part, oioStream -> {
... ...
@@ -685,13 +679,11 @@ public class ImapMailboxRecordsService extends BaseMailboxRecordsService impleme
685 679
 
686 680
 	@Override
687 681
 	public void removePart(String partId) {
688
-		rbac.check(Verb.Write.name());
689 682
 		new File(Bodies.STAGING, partId + ".part").delete();
690 683
 	}
691 684
 
692 685
 	@Override
693 686
 	public Ack updateSeens(List<SeenUpdate> updates) {
694
-		rbac.check(Verb.Write.name());
695 687
 		List<Long> seenMdn = new ArrayList<>(updates.size());
696 688
 		List<Long> seen = new ArrayList<>(updates.size());
697 689
 		List<Long> unseen = new ArrayList<>(updates.size());
... ...
@@ -880,7 +872,6 @@ public class ImapMailboxRecordsService extends BaseMailboxRecordsService impleme
880 872
 
881 873
 	@Override
882 874
 	public void multipleDeleteById(List<Long> ids) throws ServerFault {
883
-		rbac.check(Verb.Write.name());
884 875
 		if (ids.isEmpty()) {
885 876
 			logger.info("ids list is empty, nothing to delete");
886 877
 			return;