Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create admin setting for group name #6

Closed
tobiasreischmann opened this issue Nov 16, 2017 · 4 comments
Closed

Create admin setting for group name #6

tobiasreischmann opened this issue Nov 16, 2017 · 4 comments

Comments

@tobiasreischmann
Copy link
Contributor

tobiasreischmann commented Nov 16, 2017

  • Add an admin setting 'group_name' from type text. Use a heading section "Access Policies".
  • Change apibridge->create_acl_group() so that the group name from this setting is used as $params['name']. Since the static function api::get_course_acl_group_name from the repository plugin is only called here, this functionality can be moved to the block!
  • Allow placefolders [COURSEID] and [COURSENAME], which are automatically replaced by course->id and course->fullname. You can use str_replace() for that. (http://php.net/manual/de/function.str-replace.php)
@tobiasreischmann tobiasreischmann added this to the Configuration option for additional access policies milestone Nov 16, 2017
@tobiasreischmann
Copy link
Contributor Author

Currently the code distinguishes between get_course_acl_group_name, which is "Moodle_course_" . $courseid, and get_course_acl_group_identifier, which is "moodle_course_" . $courseid.
@ebbertd: Do you have an idea, why and how opencast distinguishes between these two values?

@tobiasreischmann
Copy link
Contributor Author

We identified the responsible code in Opencast:
final String groupId = name.toLowerCase().replaceAll("\W", "_");
So we need to reproduce this call in our code. The admin setting determines then the group name only and we calculate the identifier from it.

@tobiasreischmann
Copy link
Contributor Author

Additionally there seems to be a restriction of group name length to 128 Byte. I would suggest to add a hint to the admin setting, that all characters exceeding this length, will be cut. The admin has to make sure that distinguishing characters, like courseid, will not be target of these cuts!

@tobiasreischmann
Copy link
Contributor Author

tobiasreischmann commented Nov 17, 2017

We definitely need to test special characters as ä, ö, ü and ß here, because they might occur in course names. The above code is Java. In Java \W matches everything, which is not in [a-zA-Z_0-9].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant