Hi Prajwal Bhetwal,
Its role name should be "System Administrator". So try the following code:
function hasCurrentUserRole(roleName){
let hasRole = false;
let roles = Xrm.Utility.getGlobalContext().userSettings.roles;
roles.forEach(x => {
if (x.name === "System Administrator") {
hasRole = true;
return;
}
});
return hasRole;
}
And the rule should be tied to the button command.
Steps:
1. Right click the ‘DEACTIVATE’ button and open the 'Customise Command':

2. Then add your custom enable rule to command:

3. Finally, publish your solution.