001/* 002 * Copyright 2008-2018 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright (C) 2015-2018 Ping Identity Corporation 007 * 008 * This program is free software; you can redistribute it and/or modify 009 * it under the terms of the GNU General Public License (GPLv2 only) 010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only) 011 * as published by the Free Software Foundation. 012 * 013 * This program is distributed in the hope that it will be useful, 014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 016 * GNU General Public License for more details. 017 * 018 * You should have received a copy of the GNU General Public License 019 * along with this program; if not, see <http://www.gnu.org/licenses>. 020 */ 021package com.unboundid.ldap.sdk.unboundidds.controls; 022 023 024 025import com.unboundid.util.StaticUtils; 026import com.unboundid.util.ThreadSafety; 027import com.unboundid.util.ThreadSafetyLevel; 028 029 030 031/** 032 * This enum contains the set of possible entry-level rights that may be 033 * described in an entry retrieved with the get effective rights control. 034 * <BR> 035 * <BLOCKQUOTE> 036 * <B>NOTE:</B> This class, and other classes within the 037 * {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only 038 * supported for use against Ping Identity, UnboundID, and 039 * Nokia/Alcatel-Lucent 8661 server products. These classes provide support 040 * for proprietary functionality or for external specifications that are not 041 * considered stable or mature enough to be guaranteed to work in an 042 * interoperable way with other types of LDAP servers. 043 * </BLOCKQUOTE> 044 */ 045@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 046public enum EntryRight 047{ 048 /** 049 * The entry right that indicates that the user has sufficient permission to 050 * add a subordinate of the target entry. 051 */ 052 ADD("add"), 053 054 055 056 /** 057 * The entry right that indicates that the user has sufficient permission to 058 * delete the target entry. 059 */ 060 DELETE("delete"), 061 062 063 064 /** 065 * The entry right that indicates that the user has sufficient permission to 066 * perform read operations with the entry. 067 */ 068 READ("read"), 069 070 071 072 /** 073 * The entry right that indicates that the user has sufficient permission to 074 * perform write operations with the entry. 075 */ 076 WRITE("write"), 077 078 079 080 /** 081 * The entry right that indicates that the user has sufficient permission to 082 * perform operations involving proxied authorization with the entry. 083 */ 084 PROXY("proxy"); 085 086 087 088 // The name of this entry right. 089 private final String name; 090 091 092 093 /** 094 * Creates a new entry right with the specified name. 095 * 096 * @param name The name for this entry right. 097 */ 098 EntryRight(final String name) 099 { 100 this.name = name; 101 } 102 103 104 105 /** 106 * Retrieves the name of this entry right. 107 * 108 * @return The name of this entry right. 109 */ 110 public String getName() 111 { 112 return name; 113 } 114 115 116 117 /** 118 * Retrieves the entry right for the specified name. 119 * 120 * @param name The name for which to retrieve the corresponding entry right. 121 * 122 * @return The requested entry right, or {@code null} if there is no such 123 * right. 124 */ 125 public static EntryRight forName(final String name) 126 { 127 switch (StaticUtils.toLowerCase(name)) 128 { 129 case "add": 130 return ADD; 131 case "delete": 132 return DELETE; 133 case "read": 134 return READ; 135 case "write": 136 return WRITE; 137 case "proxy": 138 return PROXY; 139 default: 140 return null; 141 } 142 } 143 144 145 146 /** 147 * Retrieves a string representation of this entry right. 148 * 149 * @return A string representation of this entry right. 150 */ 151 @Override() 152 public String toString() 153 { 154 return name; 155 } 156}