I am pulling both normal developer apps and company apps to a user's "developer apps" page. The company apps selected for display is based on:
Now, when the user clicks to edit a company app, the requested page returns a 403 (forbidden) error. The edit page url is of the form:
http://devportal.dev/user/26/apps/<app uuid>/edit-app
How can I provide edit access to company apps?
Dear @williamking ,
App edit access is given to only App Developer (App Created User) . Is logged in user same as App Developer ? Logged in user cannot edit other users developer apps in company apps listing.
Please find the piece of code that does this control in devconnecte_developer_apps.module
function devconnect_developer_apps_access($account, $permission, $app_id = NULL) { if (user_access('administer developer apps')) { return TRUE; } if (user_is_logged_in() && $account->uid == $GLOBALS['user']->uid && user_access("$permission developer apps", $account)) { if ($permission == 'view' || $permission == 'create') { return TRUE; } else { $app = entity_load_single('developer_app', $app_id); if ($app->developer == $account->mail) { return TRUE; } return FALSE; } } return FALSE; }
And also, Make sure "Edit Developer Apps" is given the role that user is trying to edit in "admin/people/permissions"
Cheers,
Anil Sagar
I believe all of that information is specific to developer apps. When you create a company app, there is no "developer" associated with it. There are developers added to a company, but not to the specific app (as best I can tell at least).
One consequence is that the developer value of $app does not exist, and so the following check will always return false for a company app:
if ($app->developer == $account->mail) { return TRUE; } return FALSE;
@williamking , You are right. I have tested using Administrator user where Administer Developer Apps permission was given so that i can edit. I have tested as normal user and it gives access denied error message.
It's a bug in developer portal. I will raise with team and get it fixed in future release of developer portal. Till then either you can use Administer Developer Apps permission or override access by implementing a custom module to fix the issue in core.
@williamking , Let me know if you need any help with custom module for developer portal to fix above issue.
Thanks! I am already working within a custom module created by @Gitesh Koli, and I think I've got it mostly figured out.
Aweseome 🙂
Hi williamking,it would be helpful if you provide that custom module
@Anil Sagar this is not a bug in the dev portal. This is a feature that needs to be customised by adding a custom module to dev portal.
@Anil Sagar Or @Divya Achan OR Team,
Is this edit app feature available for company apps in latest versions?
is this still not supported or added this in latest versions?