I am trying to make command, that works if the author has admin or owner role. But I don't know how to check if user has "admin" OR "owner" role (multiple roles). And I am using discord.js v12.
My code:
client.on('message', message => {
if (message.content.startsWith('!ban'))
if(message.member.roles.cache.find(r => r.name === "owner")) {
message.delete();
let member1 = message.mentions.members.first();
if(!member1) return message.channel.send("You need to mention the @user!").then((declineMsg) => {
declineMsg.delete({timeout: 5000});})
let banned = message.guild.roles.cache.find(role => role.name === "banned");
member1.roles.add(banned);
message.channel.send('Succesfully banned user!').then(message.delete({timeout: 5000}))}});
});
client.on('message', message => {
if (message.content.startsWith('!ban'))
if(message.member.roles.cache.find(r => r.name === "admin")) {
message.delete();
let member1 = message.mentions.members.first();
if(!member1) return message.channel.send("You need to mention the @user!").then((declineMsg) => {
declineMsg.delete({timeout: 5000});})
let banned = message.guild.roles.cache.find(role => role.name === "banned");
member1.roles.add(banned);
message.channel.send(`Succesfully banned user!`).then(message.delete({timeout: 5000}))}});
});
Steps for Role Comparing: Click on Across systems option it will give option to select the sys name under Remote Comparison there enter the SYS ID between which system you want to do comparison and put the role name in compare role section then execute it will give you the result.
User Comparison will reconcile the PROFILES within a user's account and make the necessary changes. This is especially true when you've assigned specific Valid-To dates for the roles on an account. If the Valid-To (expiry) date of a role has passed, the User Comparison will REMOVE the profile/role from that account.
SAP Transaction Codes for Mass User Comparison — the most relevant and popular TCodes are listed at the top. You can click on TCodes to view more information like related TCodes, SAP Help/reference pages, etc. You can also click on the Functional Area to view all the TCodes for that module/sub-module.
The first way to check for user roles in Java is to use the @PreAuthorize annotation provided by Spring Security. This annotation can be applied to a class or method, and it accepts a single string value that represents a SpEL expression. Before we can use this annotation, we must first enable global method security.
Listing SQL Server roles for a user. 1 Start Microsoft SQL Server Management Studio (MSSMS). 2 On the File menu, click Connect Object Explorer. 3 In the Connect to Server dialog box, specify the following settings:
For role comparison both the roles must be in the same system, in same client. Transaction code SUIM -> Comparison-> Roles If the roles are in different system, then transport the role into one of the system and do comparison. If no transport connection defined then, you can use the upload and download option in the PFCG.
Each SQL database can also have its own unique permissions and roles. In order to maintain security and comply with many regulations, including PCI DSS and HIPAA, you need to know all the server and database roles assigned to each user. That’s a tough job if all you have are native tools because of all the complexity involved.
You need to use something like this:
let role1 = message.guild.roles.cache.find(r => r.name === "owner");
let role2 = message.guild.roles.cache.find(r => r.name === "admin");
if(!message.member.roles.cache.has(role1.id) && !message.member.roles.cache.has(role2.id)) return message.reply("User don't have required roles!")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With