WordPress.org

Making WordPress.org

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#1240 closed defect (fixed)

Change storage of per-project permissions

Reported by: ocean90 Owned by: ocean90
Milestone: Priority: high
Component: Translate Site & Plugins Keywords:
Cc:

Description

Currently the project IDs are stored in a user meta. That was a bad idea because there is no easy way to get all translation editors (or contributors) of a project per locale.

We should have a separate table for this. Fields: User ID, Project ID, Locale, Locale Slug, Status (editor/contributor/blocked?)

Change History (16)

#1 @ocean90
4 years ago

  • Owner set to ocean90
  • Status changed from new to assigned

This ticket was mentioned in Slack in #meta-i18n by ocean90. View the logs.


4 years ago

This ticket was mentioned in Slack in #meta-i18n by ocean90. View the logs.


4 years ago

#4 @alex-ye
4 years ago

  • Cc nashwan.doaqan@… added

@ocean90 Is there anything we can do to help in this ticket?!

#5 @ocean90
4 years ago

#1354 was marked as a duplicate.

#6 @kosvrouvas
4 years ago

  • Cc kosvrouvas@… added

#7 @ocean90
4 years ago

#1374 was marked as a duplicate.

This ticket was mentioned in Slack in #polyglots by ocean90. View the logs.


4 years ago

#9 @ocean90
4 years ago

Related: #1398

Current plan is to use the new table only for project translation editors. Schema:

CREATE TABLE `translate_translation_editors` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `project_id` int(10) NOT NULL,
  `locale` varchar(255) NOT NULL DEFAULT '',
  `locale_slug` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_project_id` (`user_id`, `project_id`, `locale`,`locale_slug`),
  KEY `locale` (`locale`, `locale_slug`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

To handle General Translation Editors a new role will be introduced.

#10 @ocean90
4 years ago

In 2195:

Credits API: Use the new table for locale validators.

Validators aka Translation Editors are now stored in a separate database table to be able to distinguish between Project Translation Editors and General Translation Editors.

See #1240.

#11 @ocean90
4 years ago

In 2196:

Translate: Use the new translation_editors table to retrieve the project ID access list of a user.

See #1240.

#12 @ocean90
4 years ago

In 2197:

Rosetta: Update roles plugin to use the new translation_editors table.

  • Introduce a new role for General Translation Editors.
  • Introduce a new capability to manage Translation Editors, assigned to General Translation Editors.
  • Fix wrong action name for bulk removal.
  • Remove custom "Role" column, obsolete with WordPress 4.4.
  • Introduce translation_editor_added, translation_editor_updated and translation_editor_removed actions.
  • Make "Translation Editors" a top-level menu.
  • Add views to the "Translation Editors" table.

See #1240.

#13 @ocean90
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

The migration was done a few hours ago, no issues so far. Closing as fixed.

#14 @ocean90
3 years ago

In 2237:

Rosetta Roles: Remove unused $wpdb global imports.

Also fixes some code style issues.

See #1240.

#15 @ocean90
3 years ago

In 2252:

Rosetta Roles: Add missing text domains.

See #1240.

#16 @ocean90
3 years ago

In 2262:

Translate: Update roles plugin (WP version) to use the new translation_editors table.

See #1240, #1352.

Note: See TracTickets for help on using tickets.