File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,14 +197,25 @@ export class Permissions extends SubModule {
197197 securityToken : { symbol, features } ,
198198 } = this ;
199199
200- const isPermissionsEnabled = await features . isEnabled ( { feature : Feature . Permissions } ) ;
200+ const [ isPermissionsEnabled , requiredFeature ] = await Promise . all ( [
201+ features . isEnabled ( { feature : Feature . Permissions } ) ,
202+ this . getFeatureFromRole ( { role } ) ,
203+ ] ) ;
201204 if ( ! isPermissionsEnabled ) {
202205 throw new PolymathError ( {
203206 code : ErrorCode . FeatureNotEnabled ,
204207 message : 'You must enable the Permissions feature' ,
205208 } ) ;
206209 }
207210
211+ const isFeatureEnabled = await features . isEnabled ( { feature : requiredFeature } ) ;
212+ if ( ! isFeatureEnabled ) {
213+ throw new PolymathError ( {
214+ code : ErrorCode . FeatureNotEnabled ,
215+ message : `You must enable the ${ requiredFeature } feature to check delegates for role ${ role } ` ,
216+ } ) ;
217+ }
218+
208219 const generalPermissionManager = ( await contractWrappers . getAttachedModules (
209220 { moduleName : ModuleName . GeneralPermissionManager , symbol } ,
210221 { unarchived : true }
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export class AssignSecurityTokenRole extends Procedure<AssignSecurityTokenRolePr
3434 if ( ! permissionModule ) {
3535 throw new PolymathError ( {
3636 code : ErrorCode . ProcedureValidationError ,
37- message : 'You must enable the Permissions feature' ,
37+ message : 'You must enable the Permissions feature in order to assign roles ' ,
3838 } ) ;
3939 }
4040
@@ -51,7 +51,7 @@ export class AssignSecurityTokenRole extends Procedure<AssignSecurityTokenRolePr
5151 if ( ! isAvailable ) {
5252 throw new PolymathError ( {
5353 code : ErrorCode . FeatureNotEnabled ,
54- message : `You must enable the ${ requiredFeature } feature` ,
54+ message : `You must enable the ${ requiredFeature } feature in order to assign the ${ role } role ` ,
5555 } ) ;
5656 }
5757
You can’t perform that action at this time.
0 commit comments