File tree Expand file tree Collapse file tree 5 files changed +50
-5
lines changed
Contentstack.Management.Core.Unit.Tests/Models
Contentstack.Management.Core/Models Expand file tree Collapse file tree 5 files changed +50
-5
lines changed Original file line number Diff line number Diff line change 66 security-sca :
77 runs-on : ubuntu-latest
88 steps :
9- - uses : actions/checkout@master
9+ - name : Checkout repository
10+ uses : actions/checkout@master
11+ - name : Run Dotnet Restore
12+ run : |
13+ dotnet restore
1014 - name : Run Snyk to check for vulnerabilities
1115 uses : snyk/actions/dotnet@master
1216 env :
1317 SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
1418 with :
15- args : --fail-on=all
19+ args : --file=Contentstack.Management.Core/obj/project.assets.json -- fail-on=all
Original file line number Diff line number Diff line change @@ -24,5 +24,4 @@ packages/
2424* /mono **
2525* /appSettings.json
2626api_referece /*
27- .sonarqube /
28- CSManagementSDK.snk
27+ .sonarqube /
Original file line number Diff line number Diff line change @@ -142,5 +142,23 @@ public async System.Threading.Tasks.Task Should_Delete_Role_Async()
142142 Assert . AreEqual ( _contentstackResponse . OpenResponse ( ) , response . OpenResponse ( ) ) ;
143143 Assert . AreEqual ( _contentstackResponse . OpenJObjectResponse ( ) . ToString ( ) , response . OpenJObjectResponse ( ) . ToString ( ) ) ;
144144 }
145+
146+ [ TestMethod ]
147+ public void Should_Create_Role_With_Taxonomy_Permissions ( )
148+ {
149+ ContentstackResponse response = _stack . Role ( ) . Create ( _fixture . Create < RoleModel > ( ) ) ;
150+
151+ Assert . AreEqual ( _contentstackResponse . OpenResponse ( ) , response . OpenResponse ( ) ) ;
152+ Assert . AreEqual ( _contentstackResponse . OpenJObjectResponse ( ) . ToString ( ) , response . OpenJObjectResponse ( ) . ToString ( ) ) ;
153+ }
154+
155+ [ TestMethod ]
156+ public void Should_Update_Role_With_Taxonomy_Permissions ( )
157+ {
158+ ContentstackResponse response = _stack . Role ( _fixture . Create < string > ( ) ) . Update ( _fixture . Create < RoleModel > ( ) ) ;
159+
160+ Assert . AreEqual ( _contentstackResponse . OpenResponse ( ) , response . OpenResponse ( ) ) ;
161+ Assert . AreEqual ( _contentstackResponse . OpenJObjectResponse ( ) . ToString ( ) , response . OpenJObjectResponse ( ) . ToString ( ) ) ;
162+ }
145163 }
146164}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public class ContentTypeRules: Rule
3636 public List < string > ContentTypes { get ; set ; }
3737 }
3838
39- public class BrancheRules : Rule
39+ public class BranchRules : Rule
4040 {
4141 [ JsonProperty ( propertyName : "module" ) ]
4242 public string Module { get ; } = "branch" ;
@@ -80,4 +80,28 @@ public class EnvironmentRules : Rule
8080 [ JsonProperty ( propertyName : "environments" ) ]
8181 public List < string > Environments { get ; set ; }
8282 }
83+
84+ public class TaxonomyContentType
85+ {
86+ [ JsonProperty ( propertyName : "uid" ) ]
87+ public string Uid { get ; set ; }
88+
89+ [ JsonProperty ( propertyName : "acl" ) ]
90+ public Dictionary < string , object > ACL { get ; }
91+ }
92+
93+ public class TaxonomyRules : Rule
94+ {
95+ [ JsonProperty ( propertyName : "module" ) ]
96+ public string Module { get ; } = "taxonomy" ;
97+
98+ [ JsonProperty ( propertyName : "taxonomies" ) ]
99+ public List < string > Taxonomies { get ; set ; }
100+
101+ [ JsonProperty ( propertyName : "terms" ) ]
102+ public List < string > Terms { get ; set ; }
103+
104+ [ JsonProperty ( propertyName : "content_types" ) ]
105+ public List < TaxonomyContentType > ContentTypes { get ; set ; }
106+ }
83107}
You can’t perform that action at this time.
0 commit comments