File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
packages/app/src/app/overmind Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,9 @@ export const withOwnedSandbox = <T>(
8686 const sandbox = state . editor . currentSandbox ;
8787 if ( sandbox ) {
8888 if (
89- typeof requiredPermission !== 'undefined' &&
90- ! hasPermission ( sandbox . authorization , requiredPermission )
89+ typeof requiredPermission === 'undefined'
90+ ? ! sandbox . owned
91+ : ! hasPermission ( sandbox . authorization , requiredPermission )
9192 ) {
9293 if ( state . editor . isForkingSandbox ) {
9394 return cancelAction ( context , payload ) ;
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ export const codeSaved: AsyncAction<{
174174 effects . vscode . callCallbackError ( cbID ) ;
175175 }
176176 } ,
177- 'write_project '
177+ 'write_code '
178178) ;
179179
180180export const onOperationApplied : Action < {
Original file line number Diff line number Diff line change 11import getTemplate from '@codesandbox/common/lib/templates' ;
2+ import { hasPermission } from '@codesandbox/common/lib/utils/permission' ;
23
34export interface INavigationItem {
45 id : string ;
@@ -116,7 +117,11 @@ export default function getItems(store: any): INavigationItem[] {
116117 items . push ( DEPLOYMENT ) ;
117118 }
118119
119- if ( store . isLoggedIn ) {
120+ if (
121+ store . isLoggedIn &&
122+ currentSandbox &&
123+ hasPermission ( currentSandbox . authorization , 'write_code' )
124+ ) {
120125 items . push ( LIVE ) ;
121126 }
122127
You can’t perform that action at this time.
0 commit comments