File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -139,8 +139,8 @@ func filterMSDRules(domain *zms.DomainData) *zms.DomainData {
139139 roleName := string (role .Name )
140140 aclPrefix := domainName + ":role.acl."
141141 msdReadPrefix := domainName + ":role.msd-read-role-"
142- if ( len ( roleName ) >= len ( aclPrefix ) && roleName [: len ( aclPrefix )] == aclPrefix ) ||
143- ( len ( roleName ) >= len ( msdReadPrefix ) && roleName [: len ( msdReadPrefix )] == msdReadPrefix ) {
142+ if strings . HasPrefix ( roleName , aclPrefix ) ||
143+ strings . HasPrefix ( roleName , msdReadPrefix ) {
144144 continue
145145 }
146146 filteredRoles = append (filteredRoles , role )
@@ -153,8 +153,8 @@ func filterMSDRules(domain *zms.DomainData) *zms.DomainData {
153153 policyName := string (policy .Name )
154154 aclPrefix := domainName + ":policy.acl."
155155 msdReadPrefix := domainName + ":policy.msd-read-policy-"
156- if ( len ( policyName ) >= len ( aclPrefix ) && policyName [: len ( aclPrefix )] == aclPrefix ) ||
157- ( len ( policyName ) >= len ( msdReadPrefix ) && policyName [: len ( msdReadPrefix )] == msdReadPrefix ) {
156+ if strings . HasPrefix ( policyName , aclPrefix ) ||
157+ strings . HasPrefix ( policyName , msdReadPrefix ) {
158158 continue
159159 }
160160 filteredPolicies = append (filteredPolicies , policy )
You can’t perform that action at this time.
0 commit comments