Skip to content

Commit

Permalink
feat: [CO-640] chats, meeting, team feature enabled attributes (#191)
Browse files Browse the repository at this point in the history
* feat: [CO-640] new carbonioFeatureChatsEnabled carbonioFeatureMeetingEnabled, carbonioFeatureTeamEnabled in 23.5.0
  • Loading branch information
frisonisland authored Apr 3, 2023
1 parent 9fdacae commit e9843b1
Show file tree
Hide file tree
Showing 5 changed files with 373 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2729,9 +2729,9 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc
/**
* Whether the Chats feature enabled for account or COS
*
* @since ZCS 23.1.0
* @since ZCS 23.5.0
*/
@ZAttr(id=3125)
@ZAttr(id=3130)
public static final String A_carbonioFeatureChatsEnabled = "carbonioFeatureChatsEnabled";

/**
Expand All @@ -2758,6 +2758,22 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc
@ZAttr(id=3123)
public static final String A_carbonioFeatureMailsAppEnabled = "carbonioFeatureMailsAppEnabled";

/**
* Whether the Meeting feature enabled for account or COS
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3131)
public static final String A_carbonioFeatureMeetingEnabled = "carbonioFeatureMeetingEnabled";

/**
* Whether the Team feature enabled for account or COS
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3132)
public static final String A_carbonioFeatureTeamEnabled = "carbonioFeatureTeamEnabled";

/**
* Logo URL for domain
*
Expand Down
2 changes: 2 additions & 0 deletions store-conf/conf/rights/rights-domainadmin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
<a n="carbonioFeatureFilesAppEnabled"/>
<a n="carbonioFeatureFilesEnabled"/>
<a n="carbonioFeatureMailsAppEnabled"/>
<a n="carbonioFeatureMeetingEnabled"/>
<a n="carbonioFeatureTeamEnabled"/>
<a n="carbonioPrefWebUiDarkMode"/>
<a n="cn"/>
<a n="co"/>
Expand Down
24 changes: 18 additions & 6 deletions store/conf/attrs/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9981,12 +9981,6 @@ TODO: delete them permanently from here
<desc>Whether the Files feature enabled for account or COS</desc>
</attr>

<attr id="3125" name="carbonioFeatureChatsEnabled" type="boolean" cardinality="single" optionalIn="account,cos" flags="accountInfo,accountInherited,domainAdminModifiable" since="23.1.0">
<defaultCOSValue>TRUE</defaultCOSValue>
<defaultExternalCOSValue>FALSE</defaultExternalCOSValue>
<desc>Whether the Chats feature enabled for account or COS</desc>
</attr>

<attr id="3126" name="carbonioLogoUrl" type="string" max="256" cardinality="single" optionalIn="globalConfig,domain" flags="domainInherited,domainInfo,domainAdminModifiable" since="23.2.0">
<desc>Logo URL for domain</desc>
<globalConfigValue>https://www.zextras.com</globalConfigValue>
Expand All @@ -10004,4 +9998,22 @@ TODO: delete them permanently from here
<globalConfigValue>FALSE</globalConfigValue>
<desc>Whether or not Amavis should skip virus-checking</desc>
</attr>

<attr id="3130" name="carbonioFeatureChatsEnabled" type="boolean" cardinality="single" optionalIn="account,cos" flags="accountInfo,accountInherited,domainAdminModifiable" since="23.5.0">
<defaultCOSValue>FALSE</defaultCOSValue>
<defaultExternalCOSValue>FALSE</defaultExternalCOSValue>
<desc>Whether the Chats feature enabled for account or COS</desc>
</attr>

<attr id="3131" name="carbonioFeatureMeetingEnabled" type="boolean" cardinality="single" optionalIn="account,cos" flags="accountInfo,accountInherited,domainAdminModifiable" since="23.5.0">
<defaultCOSValue>FALSE</defaultCOSValue>
<defaultExternalCOSValue>FALSE</defaultExternalCOSValue>
<desc>Whether the Meeting feature enabled for account or COS</desc>
</attr>

<attr id="3132" name="carbonioFeatureTeamEnabled" type="boolean" cardinality="single" optionalIn="account,cos" flags="accountInfo,accountInherited,domainAdminModifiable" since="23.5.0">
<defaultCOSValue>FALSE</defaultCOSValue>
<defaultExternalCOSValue>FALSE</defaultExternalCOSValue>
<desc>Whether the Team feature enabled for account or COS</desc>
</attr>
</attrs>
196 changes: 170 additions & 26 deletions store/src/main/java/com/zimbra/cs/account/ZAttrAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@
import static com.zimbra.common.account.ProvisioningConstants.FALSE;
import static com.zimbra.common.account.ProvisioningConstants.TRUE;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import com.zimbra.common.account.ZAttr;
import com.zimbra.common.account.ZAttrProvisioning;
import com.zimbra.common.util.ByteUtil;
import com.zimbra.common.util.StringUtil;
import com.zimbra.cs.ldap.LdapDateUtil;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
* AUTO-GENERATED. DO NOT EDIT.
*
*/

public abstract class ZAttrAccount extends MailTarget {
/** AUTO-GENERATED. DO NOT EDIT. */
public abstract class ZAttrAccount extends MailTarget {

public ZAttrAccount(String name, String id, Map<String,Object> attrs, Map<String, Object> defaults, Provisioning prov) {
super(name, id, attrs, defaults, prov);
}
public ZAttrAccount(
String name,
String id,
Map<String, Object> attrs,
Map<String, Object> defaults,
Provisioning prov) {
super(name, id, attrs, defaults, prov);
}

///// BEGIN-AUTO-GEN-REPLACE
///// BEGIN-AUTO-GEN-REPLACE

/**
* RFC2256: ISO-3166 country 2-letter code
Expand Down Expand Up @@ -168,13 +168,13 @@ public Map<String,Object> unsetCarbonioFeatureChatsAppEnabled(Map<String,Object>
/**
* Whether the Chats feature enabled for account or COS
*
* @return carbonioFeatureChatsEnabled, or true if unset
* @return carbonioFeatureChatsEnabled, or false if unset
*
* @since ZCS 23.1.0
* @since ZCS 23.5.0
*/
@ZAttr(id=3125)
@ZAttr(id=3130)
public boolean isCarbonioFeatureChatsEnabled() {
return getBooleanAttr(Provisioning.A_carbonioFeatureChatsEnabled, true, true);
return getBooleanAttr(Provisioning.A_carbonioFeatureChatsEnabled, false, true);
}

/**
Expand All @@ -183,9 +183,9 @@ public boolean isCarbonioFeatureChatsEnabled() {
* @param carbonioFeatureChatsEnabled new value
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 23.1.0
* @since ZCS 23.5.0
*/
@ZAttr(id=3125)
@ZAttr(id=3130)
public void setCarbonioFeatureChatsEnabled(boolean carbonioFeatureChatsEnabled) throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureChatsEnabled, carbonioFeatureChatsEnabled ? TRUE : FALSE);
Expand All @@ -199,9 +199,9 @@ public void setCarbonioFeatureChatsEnabled(boolean carbonioFeatureChatsEnabled)
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 23.1.0
* @since ZCS 23.5.0
*/
@ZAttr(id=3125)
@ZAttr(id=3130)
public Map<String,Object> setCarbonioFeatureChatsEnabled(boolean carbonioFeatureChatsEnabled, Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureChatsEnabled, carbonioFeatureChatsEnabled ? TRUE : FALSE);
Expand All @@ -213,9 +213,9 @@ public Map<String,Object> setCarbonioFeatureChatsEnabled(boolean carbonioFeature
*
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 23.1.0
* @since ZCS 23.5.0
*/
@ZAttr(id=3125)
@ZAttr(id=3130)
public void unsetCarbonioFeatureChatsEnabled() throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureChatsEnabled, "");
Expand All @@ -228,9 +228,9 @@ public void unsetCarbonioFeatureChatsEnabled() throws com.zimbra.common.service.
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 23.1.0
* @since ZCS 23.5.0
*/
@ZAttr(id=3125)
@ZAttr(id=3130)
public Map<String,Object> unsetCarbonioFeatureChatsEnabled(Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureChatsEnabled, "");
Expand Down Expand Up @@ -453,6 +453,150 @@ public Map<String,Object> unsetCarbonioFeatureMailsAppEnabled(Map<String,Object>
return attrs;
}

/**
* Whether the Meeting feature enabled for account or COS
*
* @return carbonioFeatureMeetingEnabled, or false if unset
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3131)
public boolean isCarbonioFeatureMeetingEnabled() {
return getBooleanAttr(Provisioning.A_carbonioFeatureMeetingEnabled, false, true);
}

/**
* Whether the Meeting feature enabled for account or COS
*
* @param carbonioFeatureMeetingEnabled new value
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3131)
public void setCarbonioFeatureMeetingEnabled(boolean carbonioFeatureMeetingEnabled) throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureMeetingEnabled, carbonioFeatureMeetingEnabled ? TRUE : FALSE);
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Whether the Meeting feature enabled for account or COS
*
* @param carbonioFeatureMeetingEnabled new value
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3131)
public Map<String,Object> setCarbonioFeatureMeetingEnabled(boolean carbonioFeatureMeetingEnabled, Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureMeetingEnabled, carbonioFeatureMeetingEnabled ? TRUE : FALSE);
return attrs;
}

/**
* Whether the Meeting feature enabled for account or COS
*
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3131)
public void unsetCarbonioFeatureMeetingEnabled() throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureMeetingEnabled, "");
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Whether the Meeting feature enabled for account or COS
*
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3131)
public Map<String,Object> unsetCarbonioFeatureMeetingEnabled(Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureMeetingEnabled, "");
return attrs;
}

/**
* Whether the Team feature enabled for account or COS
*
* @return carbonioFeatureTeamEnabled, or false if unset
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3132)
public boolean isCarbonioFeatureTeamEnabled() {
return getBooleanAttr(Provisioning.A_carbonioFeatureTeamEnabled, false, true);
}

/**
* Whether the Team feature enabled for account or COS
*
* @param carbonioFeatureTeamEnabled new value
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3132)
public void setCarbonioFeatureTeamEnabled(boolean carbonioFeatureTeamEnabled) throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureTeamEnabled, carbonioFeatureTeamEnabled ? TRUE : FALSE);
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Whether the Team feature enabled for account or COS
*
* @param carbonioFeatureTeamEnabled new value
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3132)
public Map<String,Object> setCarbonioFeatureTeamEnabled(boolean carbonioFeatureTeamEnabled, Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureTeamEnabled, carbonioFeatureTeamEnabled ? TRUE : FALSE);
return attrs;
}

/**
* Whether the Team feature enabled for account or COS
*
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3132)
public void unsetCarbonioFeatureTeamEnabled() throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureTeamEnabled, "");
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Whether the Team feature enabled for account or COS
*
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 23.5.0
*/
@ZAttr(id=3132)
public Map<String,Object> unsetCarbonioFeatureTeamEnabled(Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_carbonioFeatureTeamEnabled, "");
return attrs;
}

/**
* Web UI Dark Mode preference for account
*
Expand Down
Loading

0 comments on commit e9843b1

Please sign in to comment.