Rename role parameter in PermissionDescription.Builder#assign
This commit is contained in:
parent
d1e76f401a
commit
174ef187e8
@ -72,9 +72,9 @@ public final class DescriptionBuilder implements PermissionDescription.Builder {
|
|||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public PermissionDescription.Builder assign(@Nonnull String permission, boolean value) {
|
public PermissionDescription.Builder assign(@Nonnull String role, boolean value) {
|
||||||
Objects.requireNonNull(permission, "permission");
|
Objects.requireNonNull(role, "role");
|
||||||
this.roles.put(permission, Tristate.fromBoolean(value));
|
this.roles.put(role, Tristate.fromBoolean(value));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +90,8 @@ public final class DescriptionBuilder implements PermissionDescription.Builder {
|
|||||||
// Set role-templates
|
// Set role-templates
|
||||||
LPSubjectCollection subjects = this.service.getCollection(PermissionService.SUBJECTS_ROLE_TEMPLATE);
|
LPSubjectCollection subjects = this.service.getCollection(PermissionService.SUBJECTS_ROLE_TEMPLATE);
|
||||||
for (Map.Entry<String, Tristate> assignment : this.roles.entrySet()) {
|
for (Map.Entry<String, Tristate> assignment : this.roles.entrySet()) {
|
||||||
LPSubject subject = subjects.loadSubject(assignment.getKey()).join();
|
LPSubject roleSubject = subjects.loadSubject(assignment.getKey()).join();
|
||||||
subject.getTransientSubjectData().setPermission(ContextSet.empty(), this.id, assignment.getValue());
|
roleSubject.getTransientSubjectData().setPermission(ContextSet.empty(), this.id, assignment.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.service.getPlugin().getPermissionVault().offer(this.id);
|
this.service.getPlugin().getPermissionVault().offer(this.id);
|
||||||
|
@ -72,9 +72,9 @@ public final class DescriptionBuilder implements PermissionDescription.Builder {
|
|||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public PermissionDescription.Builder assign(@Nonnull String permission, boolean value) {
|
public PermissionDescription.Builder assign(@Nonnull String role, boolean value) {
|
||||||
Objects.requireNonNull(permission, "permission");
|
Objects.requireNonNull(role, "role");
|
||||||
this.roles.put(permission, Tristate.fromBoolean(value));
|
this.roles.put(role, Tristate.fromBoolean(value));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +90,8 @@ public final class DescriptionBuilder implements PermissionDescription.Builder {
|
|||||||
// Set role-templates
|
// Set role-templates
|
||||||
LPSubjectCollection subjects = this.service.getCollection(PermissionService.SUBJECTS_ROLE_TEMPLATE);
|
LPSubjectCollection subjects = this.service.getCollection(PermissionService.SUBJECTS_ROLE_TEMPLATE);
|
||||||
for (Map.Entry<String, Tristate> assignment : this.roles.entrySet()) {
|
for (Map.Entry<String, Tristate> assignment : this.roles.entrySet()) {
|
||||||
LPSubject subject = subjects.loadSubject(assignment.getKey()).join();
|
LPSubject roleSubject = subjects.loadSubject(assignment.getKey()).join();
|
||||||
subject.getTransientSubjectData().setPermission(ContextSet.empty(), this.id, assignment.getValue());
|
roleSubject.getTransientSubjectData().setPermission(ContextSet.empty(), this.id, assignment.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.service.getPlugin().getPermissionVault().offer(this.id);
|
this.service.getPlugin().getPermissionVault().offer(this.id);
|
||||||
|
Loading…
Reference in New Issue
Block a user